Hi Aspose team,
I have some VDX documents and when I try to make change of VBA in VDX documents I see that change is done but after saving document change is not saved.
Coding is from your example:
public void UpdateVBA()
{
try
{
Diagram diagram = new Diagram("test.vdx");
Aspose.Diagram.Vba.VbaProject v = diagram.VbaProject;
{
try
{
Diagram diagram = new Diagram("test.vdx");
Aspose.Diagram.Vba.VbaProject v = diagram.VbaProject;
// Iterate through the modules and modify VBA module code
foreach (VbaModule module in diagram.VbaProject.Modules)
{
string code = module.Codes;
if (code.Contains("SOMETHING"))
code = code.Replace("SOMETHING", "OLIVER");
module.Codes = code;
}
// Save the Visio diagram
diagram.Save("Output.vdx", SaveFileFormat.VDX);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
throw;
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
throw;
}
Is it possible to make changes of VBA in VDX documents and to save that change?
Btw. when I open VDX document, make change in VBA and save outcome document as VSDM VBA change is also saved.