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

Is there any way via code to determine how Excel was opened? I want to run a
startup macro but only if Excel is opened via automation. Specifically, I'm
writing to an excel sheet from SQL server using OPENROWSET and I want to
clear the previous data first.

TIA

Matt


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default determine how excel was opened

Not directly, though you might be able to infer if the instance was
automated if normally you'd expect a personal.xls and one or more installed
addins to be loaded. If not present as expected would likely mean it was
originally automated (though not necessarily an longer).

The 'specific' details you gave does not give any useful information as to
why you want to know.

Regards,
Peter T

"Matt Williamson" wrote in message
...
Is there any way via code to determine how Excel was opened? I want to run
a startup macro but only if Excel is opened via automation. Specifically,
I'm writing to an excel sheet from SQL server using OPENROWSET and I want
to clear the previous data first.

TIA

Matt



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default determine how excel was opened

Not directly, though you might be able to infer if the instance was
automated if normally you'd expect a personal.xls and one or more
installed addins to be loaded. If not present as expected would likely
mean it was originally automated (though not necessarily an longer).

The 'specific' details you gave does not give any useful information as to
why you want to know.


Is there any way via code to determine how Excel was opened? I want to
run a startup macro but only if Excel is opened via automation.
Specifically, I'm writing to an excel sheet from SQL server using
OPENROWSET and I want to clear the previous data first.

TIA

Matt


I have to re-think this. OPENROWSET doesn't instantiate an instance of Excel
so I doubt any opening code would run. I'll just make a blank template and
create a copy to dump the results into.


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
how do i determine when a file was last opened manreis Excel Discussion (Misc queries) 1 July 22nd 06 04:44 PM
Determine if XL file opened from Outlook or a saved file quartz[_2_] Excel Programming 1 September 16th 05 09:50 PM
stop excel file opened as read only if already opened by another u bobm Excel Programming 3 August 5th 05 04:11 PM
How to determine an opened sheet( Read Only) TTD Excel Programming 2 April 19th 05 04:49 PM
How to determine if Workbook has been opened exclusively robot[_2_] Excel Programming 2 September 18th 04 09:42 PM


All times are GMT +1. The time now is 06:31 PM.

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

About Us

"It's about Microsoft Excel"