HotXLS Docs

SaveVBAProjectToFile method

Saves the workbook's preserved classic XLS VBA OLE storage payload to a compound file. Use this when an application needs to archive, transfer, or reattach the raw VBA payload separately from the workbook file.

Syntax

function SaveVBAProjectToFile(FileName: WideString): Integer;

Return value

Returns 1 when the payload is saved; returns a negative value when the workbook has no VBA payload or the file cannot be created.

Example

if Workbook.HasVBAProject then
  Workbook.SaveVBAProjectToFile('C:\Reports\MacroPayload.ole');

See also