Command Button

Toyotagrl

Registered User.
Local time
Today, 11:08
Joined
Sep 18, 2002
Messages
10
I want to put a command button on my form to open an Excel file. I have used runapp and the command but it still doesn't work - Help... :confused:
 
I don't think you can use the RunApp in Vb. Check out the Shell Command instead.

Col
 
The Shell function or the FollowHyperlink method will do what you want.

Call Shell("C:\Program Files\Microsoft Office\Office\Excel.exe X:\Files\Test123.xls", vbNormalFocus)

Application.FollowHyperlink "X:\Files\Test123.xls"

HTH
 
For the purists in the forum they'll probably not agree with this suggestion but here goes anyway. Build a macro using the RunApp Action, then the Command Line argument should be the location of your Excel.Exe file (use Start | Search | Files to locate). Sample command line is c:\Microsoft Office 2000\Office\Excel.exe HTH JT
 
Macros are not advised since you can not trap for any errors within a macro. If the file does not exist in the macro that you suggested then the macro would error.
 

Users who are viewing this thread

Back
Top Bottom