Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How do I determine how excel was launched

I have a file in my XLSTART directory with an Auto_Open macro in it that
obviously runs everytime I start Excel. But I need it to do different
things depending upon how Excel was started so I'm looking to determine this
within the VBA code.
I look at start method 1 as being Excel was selected in the Start Menu (or
quick launch or desktop, etc) so it starts without opening a user selected
file.
And start method 2 was when an excel file was double clicked within windows
explorer (or as mail attachment etc) such that the user selected file opens
with the Excel startup

Any help would be appreciated.

Thank You


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How do I determine how excel was launched

While not reliable, in the first case wouldn't there be a Book1 (no
extension) and in the second there would not. Of course, everything
doesn't happen instantaneously, so I don't know whether Book1 would be
present at the time your workbook is opened. Guess you would have to test
it.

--
Regards,
Tom Ogilvy

"Gilgamesh" wrote in message
...
I have a file in my XLSTART directory with an Auto_Open macro in it that
obviously runs everytime I start Excel. But I need it to do different
things depending upon how Excel was started so I'm looking to determine

this
within the VBA code.
I look at start method 1 as being Excel was selected in the Start Menu (or
quick launch or desktop, etc) so it starts without opening a user selected
file.
And start method 2 was when an excel file was double clicked within

windows
explorer (or as mail attachment etc) such that the user selected file

opens
with the Excel startup

Any help would be appreciated.

Thank You




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How do I determine how excel was launched

"Tom Ogilvy" wrote in message
...
While not reliable, in the first case wouldn't there be a Book1 (no
extension) and in the second there would not. Of course, everything
doesn't happen instantaneously, so I don't know whether Book1 would be
present at the time your workbook is opened. Guess you would have to test
it.


Unfortunately as the file in XLSTART is opened for some reason EXCEL says
there is an open file and does not create the empty Book1 file.
In fact the macro I'm putting together is supposed to generate the Book1
file for easy use to compensate for multiple files in XLSTART. It works
when just launcing excel as per method 1 but the problem I have is that it
also creates a Book1 file when double clicking on an excel file (as well as
opening the selected excel file) as per method 2.


--
Regards,
Tom Ogilvy

"Gilgamesh" wrote in message
...
I have a file in my XLSTART directory with an Auto_Open macro in it that
obviously runs everytime I start Excel. But I need it to do different
things depending upon how Excel was started so I'm looking to determine

this
within the VBA code.
I look at start method 1 as being Excel was selected in the Start Menu
(or
quick launch or desktop, etc) so it starts without opening a user
selected
file.
And start method 2 was when an excel file was double clicked within

windows
explorer (or as mail attachment etc) such that the user selected file

opens
with the Excel startup

Any help would be appreciated.

Thank You






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel comes up gray screen when first launched G Excel Discussion (Misc queries) 0 November 5th 08 06:36 PM
Excel minimizes when a linked file launched Gregg Excel Discussion (Misc queries) 0 February 28th 06 05:11 PM
XLSSTART\ does not works when Excel is launched from other application Vliegenmepper Excel Discussion (Misc queries) 1 September 15th 05 12:15 PM
Auto-displaying a template when Excel is launched Heidi Excel Discussion (Misc queries) 1 July 28th 05 03:10 AM
Can you tell how Excel is launched? Gail Hurn Excel Programming 3 January 11th 05 05:47 PM


All times are GMT +1. The time now is 02:24 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"