Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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, |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Opening an Office 2007 Excel file in Office 2003 | Excel Discussion (Misc queries) | |||
Opening Different Programs using Excel. | Excel Worksheet Functions | |||
opening different programs with excel macro buttons | Excel Worksheet Functions | |||
OPENING TWO DIFFERENT EXCEL PROGRAMS | Excel Discussion (Misc queries) |