I use Excel vba procedures to open and manipulate visio drawings:
To selecting a file in a dialogue box:
visFilePath = Application.GetSaveAsFilename(options_EndUser_OpenFile_DefaultPath, fileFilterString) 'default defined by Const
If visFilePath <> "False" Then
exists = FileFolderExists(visFilePath)
dialgBxVisFileChosen = True
dialgBxVisFileChosen = False
and then early binding:
If Not IsFileOpen(visFilePath) Then
Set visioApp = New Visio.Application 'early binding
Set visQDoc = visioApp.Documents.Open(visFilePath)
Set pgs = visQDoc.Pages
Now I want to open a second visio file so I can copy visio shapes from one file to the other.
I'm trying to work out a simple scheme, and worry that I will run into gotchas..
I propose to make two versions of all the variables above, distinguishing a don_vis file (copy domor) and rec_vis file (copy recipient): extending for example:
don_visFilePath & rec_visFilePath
don_visioApp & rec_visioApp etc etc
The inter file copying code would be focused on don_shapes and rec_shapes as members of don_pages and rec_pages collections.
I can send event signals between excel and visio, in either direction, and have copied shapes within single visio files.
What worries me about my simple approach is, inexperience! Where is this simple approach likely to cause me problems?