Desktop Shortcut to launch Excel & Application

markkramer

Board Regular
Joined
May 8, 2002
Messages
162
I have two desktop shortcuts. One launches Excel and opens a workbook where I can enter information; I then close and save the workbook. The second shortcut launches a non-Microsoft application that uses the data from the workbook.

I was wondering: Is it possible to create one desktop shortcut that, first, opens the Excel workbook and then, second, launches the application immediately after the workbook is closed?

Mark
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
in your excel file (i'm assuming you are using the same file over and over) put in the following code in your 'ThisWorkbook' module in vba (hold Alt+F11 keys). The below example is just a simple example of opening Adobe Reader when you close the Excel file. Of course you'll need to update the file location to whatever program you want to open (i guess right-click your short-cut and select properties then copy the target location:

Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
 
Dim myApp As String
Dim StartmyApp
 
myApp = "C:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.exe"
 
StartmyApp = Shell(myApp, 1)

End Sub
 
Upvote 0

Forum statistics

Threads
1,225,399
Messages
6,184,752
Members
453,254
Latest member
topeb

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top