HotXLS Docs

VBAProject property

Returns a parsed TXLSVBAProject for a classic XLS workbook that contains a VBA storage. The project exposes the module count and module source text through TXLSVBAModule items. If the workbook has no VBA project, the property returns nil. Use HasVBAProject / VBADefined to test for the raw payload, LoadVBAProjectFromFile and SaveVBAProjectToFile to move the preserved OLE storage payload, and ClearVBAProject to remove it from the workbook.

Syntax

property VBAProject: TXLSVBAProject;

Example

Project := Workbook.VBAProject;
if Project <> nil then
  ModuleText := Project[1].SourceCode;

See also