Run application with VBA

J

jay

How do you run an application in vba?

The program I want to execute from a simple button:

c:\program files\winzip\winzip32.exe

Can this be done?
 
J

jay

jay said:
How do you run an application in vba?

The program I want to execute from a simple button:

c:\program files\winzip\winzip32.exe

Can this be done?


I found a simple example.



Answer: From your Access database, you can launch any application that you
wish.

For example:

Private Sub Command1_Click()

Dim stAppName As String

stAppName = "C:\Program Files\Adobe\Photoshop 6.0\Photoshp.exe"
Call Shell(stAppName, 1)

End Sub

In this example, we've created a button called Command1. When the user
clicks this button, the VBA code will create and open a session of
PhotoShop 6.0. Simply set the stAppName variable to the path of the
application that you wish to open.
 

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