Mr. Wizard
Board Regular
- Joined
- Sep 28, 2005
- Messages
- 67
I have a Visio Drawing that represents a schedule. Since the information to generate the schedule is in a database, I would like to use Excel to query the database and generate the schedule drawing elements. I have a Visio Stencil that will come up if I use a default drawing as a template, and this will allow me to drop the shapes on the Visio Drawing from the shape master.
I would like to drive Visio from Excel, so the result for the user is one-touch generation of a Visio schedule. I have referenced the Visio Library in Excel VBA Editor. I have tried recording the macro to open a file in Visio and copying it into Excel after I opened an instance of Visio, but I get an error.
It seems like this would be rather straight-forward, but it escapes me so far.
How do I open the specific Visio Drawing file in an instance of Visio driven by the Excel macro?
Here is where I've gone so far...
Public Sub VISO_text()
Dim objVis As New Visio.Application
Set objVis = New Visio.Application
Application.Documents.OpenEx "C:\DefaultSchedule.vsd", visOpenRW
Application.Windows.ItemEx("Drawing1").Activate
I would like to drive Visio from Excel, so the result for the user is one-touch generation of a Visio schedule. I have referenced the Visio Library in Excel VBA Editor. I have tried recording the macro to open a file in Visio and copying it into Excel after I opened an instance of Visio, but I get an error.
It seems like this would be rather straight-forward, but it escapes me so far.
How do I open the specific Visio Drawing file in an instance of Visio driven by the Excel macro?
Here is where I've gone so far...
Public Sub VISO_text()
Dim objVis As New Visio.Application
Set objVis = New Visio.Application
Application.Documents.OpenEx "C:\DefaultSchedule.vsd", visOpenRW
Application.Windows.ItemEx("Drawing1").Activate