In my program, I want to open a visio file but if it is already open, I want to close it and open a new version of the file. Here's the code that I currently have. I run into problems if the application is already open.
If IsNothing(VisioApplication) Then
VisioApplication = CreateObject("visio.application")
VisioPages = VisioApplication.ActiveDocument.Pages
VisioPage = VisioPages.Item(1)
VisioShapes = VisioPage.Shapes
Catch ex As Exception