VBA code to open non excel programs [Solved/Closed]

- - Latest reply:  Billybob - Jan 7, 2019 at 04:37 AM
Hello,

I need vba code to open other documents besides excel doc's

e.g open a word file, access file etc..

Can anyone help??

thanks

PM
See more 

6 replies

Best answer
approved by Jean-François Pillou on Dec 10, 2018
22
Thank you
Iv found how it works now, thanks for your help anyway!! See below code!

ActiveWorkbook.FollowHyperlink Address:="(Enter location in here, along with file name)", NewWindow:=True

Say "Thank you" 22

Glad we were able to help! Love us? Write us a review! Rate CCM

CCM 6630 users have said thank you to us this month

you can make a VBA macro stating:

Sub My_macro()

Shell ("C:\MyProgramFolder\MyProgram.exe")

End Sub


- This will open the program MyProgram.exe :)
it worked for me..Thank u
Posts
30
Registration date
Sunday August 9, 2009
Status
Member
Last seen
April 20, 2010
11
3
Thank you
Do you have example for me?
I will try as you want.
Hi,

I want to open a excel file from a specified location and that location I will mentioned in excel sheet where macro is being created(range A1 or A3).

Thanks
Posts
30
Registration date
Sunday August 9, 2009
Status
Member
Last seen
April 20, 2010
11
1
Thank you
Use hyperlinks
1
Thank you
Hi

Once the file is open, do you know how I can get the external file/doc to print using vba code??

thanks

PM
0
Thank you
I dont have an exact exmple, but im assuming it would be on the lines of the below code to open an excel file. But is there a way of opening a word file or access file??

Workbooks.Open Filename:= _
"N:\Home\Excel1.xls"

Or maybe you know of a way to assign a hyperlink to a command button, that would be a easier option.
-1
Thank you
Hi,

i want to be able to use a command button to open the files not a hyperlink.

Do you know how to do this??