Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Excel VBA to execute Visio VBA

In VBA in Excel, go to the Tools menu and set a reference to "Visio 11 Type
Library" or whatever version of Visio you have. Then use code like the
following.


Sub AAA()
Dim VIS As Visio.Application
Dim VisDoc As Visio.Document

On Error Resume Next
Set VIS = GetObject(, "Visio.Application")
If VIS Is Nothing Then
Set VIS = CreateObject("Visio.Application")
If VIS Is Nothing Then
MsgBox "Cannot access Visio"
Exit Sub
End If
End If
On Error GoTo 0
VIS.Visible = True
Set VisDoc = VIS.Documents.Add(Filename:="C:\Drawing2.vsd") '<<< CHANGE
VisDoc.ExecuteLine "MacroName" '<<< CHANGE
VisDoc.Close
VIS.Quit
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)





"Jason V" wrote in message
...
My Excel VBA program opens a visio application. From there I either want
to
run a macro in that Visio file or I want to code it in my excel program.
Any
help? Thanks.
--
Jason V



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft Visio templates - Stencil for Visio to create IT diagrams &network design Betty Carson Excel Worksheet Functions 2 December 10th 09 06:41 AM
Excel List to visio José Miguel Torres Excel Discussion (Misc queries) 0 December 19th 07 10:34 PM
Excel VBA to execute Visio VBA Bob Phillips Excel Programming 0 January 24th 07 04:51 PM
Controlling Visio from within Excel NickHK Excel Programming 0 January 10th 07 02:34 AM
Excel to Visio to Word P. Dua-Brown Excel Programming 6 January 11th 04 02:04 AM


All times are GMT +1. The time now is 12:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"