How to run EXE program from button?

G

Guest

Good day everybody,

I am using Excel 2002 and would like to create a worksheet report with a
button.
When user click the button, it will run a EXE file that will process and
update the database. The button will also refresh the database query in the
Excel worksheet.
Can anyone guide me how to write the code for the button?

Thanks in advance and have a nice day.

Best regards,
Julie
 
N

Nigel

You assign a macro to the button, in the macro use the SHELL command to call
the external EXE and to refresh you database query using the REFRESH method
of the QueryTables command.

something like
sub Update
dim retApp as Double
retApp = Shell("C:\path\application.exe")
QueryTable.Refresh BackgroundQuery:=False
end sub
 

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