How to use VB to control the VBA code in Visio?

Started by linkC, May 01, 2011, 05:32:44 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

linkC

Now,I have many visio files ,every file has a macro .
I want to creat a ".exe" file in Visual Basic  ,not in visio's VBE , so when I click the button in ".exe" file,I can control all the macro in each visio file .
Could you give me some advice?  ???

linkC

I find some code for Excel,like

Dim appExcel As Object
Set appExcel = CreateObject("Excel.Application")
appExcel.Visible = True
appExcel.Workbooks.Open "E:\test001.xls "
appExcel.Run "HelloWorld "
appExcel.Quit


I can use these code in VB to run the Visio'VBA code
But,I tried it in Visio and "Run" was prompted not exist.Why?

Jumpy

Run is an Excel-VBA command. Visio only knows Addon.Run(Arguments) to start an Addon with VBA. What you could try is the "Call" command.

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 177 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1067KB.
Tokens: post-login.
Cache hits: 13: 0.00159s for 26,589 bytes (show)
Cache misses: 2: (show)
Queries used: 16.

[Show Queries]