how to run a macro on another application using vba

✔ Recommended Answer

Visio:

Sub VISTest()    Dim VIS as Object    Set VIS= CreateObject("Visio.Application")    VIS.Documents.Open "PATH"    ' Note that the project name and module name are required to    ' path the macro correctly.    VIS.Run "MARCRONAME"End Sub

Project:

I could not test project, not having it, but look here https://msdn.microsoft.com/en-us/library/bb223292%28v=office.12%29.aspx saying

Dim pj As ObjectSet pj = CreateObject("MSProject.Project")pj.Application.FileOpen "My Project.mpp"

Be careful to enable macros in the trust center of the Office-Applications

Source: stackoverflow.com

Answered By: asdev

Comments

Most Popular

Remove Unicode Zero Width Space PHP

PhpStorm, return value is expected to be 'A', 'object' returned

Laravel file upload returns forbidden 403, file permission is 700 not 755