TXLSXWorkbook.ParsedVBAProject. If the workbook contains no
VBA storage both properties return nil.
Count. The default array property lets you write
Project[1] without naming the property explicitly.
Properties
Count property — Number of VBA modules in the project (read-only).
Item[index: Integer] property — Returns the
TXLSVBAModule at
the 1-based position index. This is the default array property.
|
var
Workbook: IXLSWorkbook;
Project: TXLSVBAProject;
i: Integer;
begin
Workbook := TXLSWorkbook.Create;
Workbook.Open('C:\MacroBook.xls');
Project := Workbook.VBAProject;
if Project <> nil then
for i := 1 to Project.Count do
Memo1.Lines.Add(Project[i].Name + ': ' + Project[i].SourceCode);
end;