RUNNING OTHER APPLICATIONS FROM EXCEL & MACROs

  • Thread starter Thread starter Bill Evans
  • Start date Start date
B

Bill Evans

How do I call up a "C" program or another application from
Excel with a Macro, or is it even possible? Can you provide
examples?

ALSO:

Can I run a particular Macro that's in a particular file
when oppened from a DOS batch file automatically? I do not
want to use the "AUTO" file names because it will do it
everytime I open Excel. I want it for a particular file
only. If so can you provide examples?
 
Take a look at Shell in VBA's help.

I don't think you could do this with a .bat file, but you could with a little
script:

'-------------

Dim xlApp
Dim xlWkbk

Set xlApp = CreateObject("excel.application")

xlApp.Visible = True

Set xlWkbk = xlApp.Workbooks.Open("C:\my documents\excel\book1.xls")
xlApp.Run xlWkbk.Name & "!Runmespecial"

xlwkbk.save
xlwkbk.close false

xlapp.quit

set xlwkbk = nothing
set xlapp = nothing

'--------------

Copy that script into notepad (change all the things that need to be
changed--whatever that means!)

And save that text file as runme.vbs

Then just double click on it in windows explorer.
 

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

Back
Top