Excel Laumch Question

FATS

New Member
Joined
Jan 16, 2009
Messages
37
Office Version
  1. 365
Platform
  1. Windows
Hi,

Would it be possible to have Excel VBA determine if its Workbook was launched automatically, such as from Windows Start-Up folder during reboot, or if I had manually opened the file by directly clicking on the file icon, or any of its shortcuts?
:confused:

Thanks

Ben
 
Last edited:

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
See if you can adapt this code

I order for the code to be functional you will need to add a shortcut to the excel application (excel.exe) to the Windows Startup Folder.

Right click the newly created excel.exe shortcut icon, choose the Properties menu and under the Target field add a commandline parameter such as AUTO .

The shortcut target should read something like ( the below exe path would be different based on your office edition)
"C:\Program Files\Microsoft Office\Office14\EXCEL.EXE" AUTO

Now, when the workbook is launched during a reboot, the code in the Workbook_Open event should prompt you how it was lauched.

Obviously, this assumes the workbook (or a shortcut to it) is in turn located in the XLStart folder so it opens automatically when excel is started.
 
Last edited:
Upvote 0
Interesting approach. Not really thought of that type of execution.

I will indeed consider it

Thanks man.
 
Upvote 0

Forum statistics

Threads
1,215,465
Messages
6,124,977
Members
449,200
Latest member
Jamil ahmed

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