Export Excel include Macro VBA

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
eayvl
User
Posts: 315

Export Excel include Macro VBA

Post by eayvl »

Hi,

When you export the information to excel it is possible to include a macro vba,

Any contribution is appreciated.


arbei
User
Posts: 9389

Post by arbei »

From https://github.com/PHPOffice/PhpSpreads ... dsheet.php, you can get/set macrosCode.

/**
* macrosCode : all macros code as binary data (the vbaProject.bin file, this include form, code, etc.), null if no macro.
*
* @var string
*/
private $macrosCode;

/**
* Set the macros code.
*
* @param string $macroCode string|null
*/
public function setMacrosCode($macroCode)
{
$this->macrosCode = $macroCode;
$this->setHasMacros($macroCode !== null);
}

/**
 * Return the macros code.
 *
 * @return null|string
 */
public function getMacrosCode()
{
    return $this->macrosCode;
}

eayvl
User
Posts: 315

Post by eayvl »

someone has an example that can share?

I have no idea how to do it, please help.

Thanks.


Post Reply