![]() |
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, |
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 |
All times are GMT +1. The time now is 10:43 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com