IVbaModule.SourceCode

IVbaModule.SourceCode property

Gets a source Code of the VBA module

public string SourceCode { get; }

Examples

Shows how to read modules of VBA project.

var project = new Project(DataDir + "VbaProject.mpp");

Console.WriteLine("Total Modules Count: " + project.VbaProject.Modules.Count);

foreach (var module in project.VbaProject.Modules)
{
    Console.WriteLine("Module Name: " + module.Name);
    Console.WriteLine("Source Code: " + module.SourceCode);
}

See Also