running OrgWiz from Excel?

M

Marshall B

I am currently running the Organizational Chart Wizard OrgWiz.exe from Excel VBA using the Shell command. The problem is half the time it will hang until I open task manager and close ORGWIZ.EXE, then it will run. ??? The other half of the time it runs fine. Is there a better way to run this, for example using the Run command in VBA? Does anyone know how to do this so I can keep everything inside VBA? Otherwise is there anyway to check the task manager processes automatically and shut one down if needed? Or any other ideas???

EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com
 
M

Marshall B

Dim visApp As Object
Dim visDoc As Visio.Document
Dim visExcelFile As String
Dim objAddOn As Object
Dim orgWizArgs As String

'Assign file location of Excel file that feeds into Visio
visExcelFile = "C:\Book2.xls"

'START VISIO'S ORG CHART WIZARD
visApp = CreateObject("Visio.Application")
Set objAddOn = visApp.Addons.ItemU("OrgCWiz")
objAddOn.Run ("/S-INIT")

'Add org chart arguments
orgWizArgs = " /FILENAME=" & visExcelFile & " /NAME-FIELD=name" 'fill in args here
objAddOn.Run ("/S-ARGSTR " + orgWizArgs)

'Run the wizard
objAddOn.Run ("/S-RUN")


EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top