Hi, I wrote a visio macro that should open all “.vsdm” files in a directory and export in an image format the content of each file. The problem is that, when a file is opened (with the Openex command) the macro halts. Maybe there is an “interference” between my macro and the macros contained in the opened files? This is the code:

Sub Exporter()

Dim xfolder As String: Dim xfile As String
Dim vsoDoc As Document: Dim astr As String
Dim vsoPage As Visio.Page

xfolder = ThisDocument.Path & "Srcdir"
xfile = Dir(xfolder & "\*.vsdm")
Do While xfile <> ""
fname = xfolder & "" & xfile
'Documents.OpenEx fname, visOpenMacrosDisabled
Set vsoDoc = Documents.OpenEx(fname, visOpenRW + visOpenMacrosDisabled)

Set vsoPage = ActivePage
astr = "C:\\Users\\foa2abt\\Desktop\\Visiodir\\Dstdir" & xfile & ".png"
vsoPage.Export (astr)

'ActiveDocument.Close SaveChanges:=False
vsoDoc.Close
xfile = Dir
Loop

End Sub