We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Change of VBA in VDX documents?

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()

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)

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.

Hi Oliver,

Thank you for contacting support. Please send us your source VDX which contains VBA. We shall investigate, and then reply appropriately. Your response is awaited.

Please find attached VDX document.

Hi Oliver,

Thank you for sending a VDX drawing. We managed to replicate the problem of not being able to modify the VBA project in VDX drawing. It has been logged under ticket ID DIAGRAMNET-51217 in our bug tracking system. Your post has also been linked to this ticket. We shall keep you informed regarding any available updates. We are sorry for the inconvenience caused.

Hi Oliver,

In reference to the ticket ID DIAGRAMNET-51217, we have resolved this problem. If there is no issue in the quality assurance phase, then it will be included in the next version 17.4.0 of Aspose.Diagram for .NET API. We shall let you know once the next version of Aspose.Diagram for .NET API is released.

The issues you have found earlier (filed as DIAGRAMNET-51217) have been fixed in Aspose.Diagram for .NET 17.4.0.

This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

just to confirm it works :).


Hi Oliver,

Thanks for the acknowledgement.

We are glad to hear that your problem is resolved. Please continue using our API’s and in the event of any further query, please feel free to contact.