-
Universal VBA code for opening MS (Office ) programs from excel
All,
I would like to develop a VBA code that opens other programs (like
PowerPoint, or Paint). The VBA code should be universal, i.e. should work on
different machines.
Since the applications will be installed on different machines and paths, I
would like to know how I can write a universal code that opens the programs,
no matter where these are installed.
Could someone give some recommendations?
Best, -
Re: Universal VBA code for opening MS (Office ) programs from excel
You have to use the Shell command, this is directly from the excel
help:
This example uses the Shell function to run an application specified by
the user. On the MacIntosh, the default drive name is "HD" and portions
of the pathname are separated by colons instead of backslashes.
Similarly, you would specify Macintosh folders instead of \Windows.
' Specifying 1 as the second argument opens the application in
' normal size and gives it the focus.
Dim RetVal
RetVal = Shell("C:\WINDOWS\CALC.EXE", 1) ' Run Calculator.
--
The Code Cage Team
Regards,
The Code Cage Team www.thecodecage.com
------------------------------------------------------------------------
The Code Cage Team's Profile: http://www.thecodecage.com/forumz/member.php?userid=2
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=25385 -
Re: Universal VBA code for opening MS (Office ) programs from excel
You have to use the Shell command, this is directly from the excel
help:
This example uses the Shell function to run an application specified by
the user. On the MacIntosh, the default drive name is "HD" and portions
of the pathname are separated by colons instead of backslashes.
Similarly, you would specify Macintosh folders instead of \Windows.
' Specifying 1 as the second argument opens the application in
' normal size and gives it the focus.
Dim RetVal
RetVal = Shell("C:\WINDOWS\CALC.EXE", 1) ' Run Calculator.
--
The Code Cage Team
Regards,
The Code Cage Team www.thecodecage.com
------------------------------------------------------------------------
The Code Cage Team's Profile: http://www.thecodecage.com/forumz/member.php?userid=2
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=25385 Posting Permissions - You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Bookmarks