PC Review


Reply
Thread Tools Rate Thread

determine how excel was opened

 
 
Matt Williamson
Guest
Posts: n/a
 
      29th Mar 2010
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


 
Reply With Quote
 
 
 
 
Peter T
Guest
Posts: n/a
 
      30th Mar 2010
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
Matt Williamson
Guest
Posts: n/a
 
      30th Mar 2010
> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i determine when a file was last opened =?Utf-8?B?bWFucmVpcw==?= Microsoft Excel Misc 1 22nd Jul 2006 04:44 PM
how to determine whether any report is opened? Zlatko Matiæ Microsoft Access 5 14th Feb 2006 08:20 PM
How to determine an opened sheet( Read Only) TTD Microsoft Excel Programming 2 19th Apr 2005 04:49 PM
Determine Directory MDB was Opened From? Dan Microsoft Access VBA Modules 2 17th Jul 2004 04:19 AM
how to determine opened web page Ruby Microsoft ASP .NET 4 18th Mar 2004 02:38 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:47 PM.