TXLSVBAProject.Item[index] (1-based).
Properties
Name property — The module name as stored in the VBA
project directory stream. Read-only.
SourceCode property — The decompressed VBA source text
of the module, decoded to a Unicode string using the project's
code page. Read/write — setting this property replaces the
in-memory source text.
|
var
Project: TXLSVBAProject;
Module: TXLSVBAModule;
i: Integer;
FirstLine: WideString;
begin
Project := Workbook.VBAProject;
if Project = nil then Exit;
for i := 1 to Project.Count do
begin
Module := Project[i];
FirstLine := Copy(Module.SourceCode, 1, 80);
ShowMessage(Module.Name + ': ' + FirstLine);
end;
end;