Link to home
Start Free TrialLog in
Avatar of Shanan212
Shanan212Flag for Canada

asked on

Running Visio Macro from VBS File

Hi,

I have the following inside a VBS/VB Script. This code runs in regular environment but when inside a VBS file, it is not running

Option Explicit
MacroExample

Sub MacroExample()

    Set AppVisio = CreateObject("visio.application")
    Dim vsoDoc As Visio.Document

    Set vsoDoc = AppVisio.Documents.Open("\\edcfs2\share2\nathsh\XenApp\Desktop\Drawing1.vsd")

    vsoDoc.ExecuteLine ("PageSel")
    Set vsoDoc = Nothing

End Sub

Open in new window


At the moment I am triggering it with a batch file - this code is tested to run 'hi world' function

 cscript \\edcfs2\share2\nathsh\XenApp\Desktop\Test\Temp\filename.vbs

Open in new window


Any help on resolving/pointing in the right direction is appreciated!
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

vbscript and VBA are not the same they are related but not the same
ASKER CERTIFIED SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Shanan212

ASKER

Thanks!