PC Review


Reply
Thread Tools Rate Thread

Addins are sometimes loaded, sometimes not

 
 
Michael G. Schneider
Guest
Posts: n/a
 
      23rd Sep 2007
In an Excel file two AddIns are used. These are the "Analysis Functions" and
"Analysis Functions - VBA" AddIns (maybe wrong name, translated from
German).

If the Excel file is opened by the user directly, anything works fine.
However, if the file is opened (on the same PC, by the same user) via a VB
dotnet program, the AddIns cannot be used directly. They have to be loaded
by code.

One more observation...

Suppose the VB program has started Excel and loaded the file. Now, if you
then open the menu command "Tools >> AddIns" (maybe wrong name, translated
from German), the two AddIns are selected. You have to remove those
selections, close the dialog, open the dialog again, and set the selections.
Only then the AddIns can be used.

However, there are also situations where an Excel file is opened from a VB
program and the AddIns are available immediately. I do not see any clue, why
this works sometimes but not all the times.

Michael G. Schneider


 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      23rd Sep 2007
That's the way excel works--when you're starting mechanically via your code,
maybe you can open the addin in the code, too???

"Michael G. Schneider" wrote:
>
> In an Excel file two AddIns are used. These are the "Analysis Functions" and
> "Analysis Functions - VBA" AddIns (maybe wrong name, translated from
> German).
>
> If the Excel file is opened by the user directly, anything works fine.
> However, if the file is opened (on the same PC, by the same user) via a VB
> dotnet program, the AddIns cannot be used directly. They have to be loaded
> by code.
>
> One more observation...
>
> Suppose the VB program has started Excel and loaded the file. Now, if you
> then open the menu command "Tools >> AddIns" (maybe wrong name, translated
> from German), the two AddIns are selected. You have to remove those
> selections, close the dialog, open the dialog again, and set the selections.
> Only then the AddIns can be used.
>
> However, there are also situations where an Excel file is opened from a VB
> program and the AddIns are available immediately. I do not see any clue, why
> this works sometimes but not all the times.
>
> Michael G. Schneider


--

Dave Peterson
 
Reply With Quote
 
Michael G. Schneider
Guest
Posts: n/a
 
      23rd Sep 2007
"Dave Peterson" <(E-Mail Removed)> schrieb im Newsbeitrag
news:(E-Mail Removed)...
> That's the way excel works--when you're starting mechanically via your
> code,
> maybe you can open the addin in the code, too???


Thanks a lot for the answer.

I do not quite understand the "that's the way excel works". Why does it make
a difference, if Excel is started by a user by double clicking the
Excel-EXE, or if Excel is started by Automation by a VB dotnet program.

Yes, I can load the AddIn by code. I just wonder, why it is necessary at
all.

Michael G. Schneider


 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      23rd Sep 2007
Just my guess (I have no real knowledge of why MS does anything).

I'm guessing that MS thought that if you were running excel via automation, then
it wouldn't be a good idea to start all the addins (or files in the XLStart
folder).

Maybe they thought it would save time. Maybe they thought that there could be
some user interaction that would have to be avoided (dismiss a message box???)
in automation mode.





"Michael G. Schneider" wrote:
>
> "Dave Peterson" <(E-Mail Removed)> schrieb im Newsbeitrag
> news:(E-Mail Removed)...
> > That's the way excel works--when you're starting mechanically via your
> > code,
> > maybe you can open the addin in the code, too???

>
> Thanks a lot for the answer.
>
> I do not quite understand the "that's the way excel works". Why does it make
> a difference, if Excel is started by a user by double clicking the
> Excel-EXE, or if Excel is started by Automation by a VB dotnet program.
>
> Yes, I can load the AddIn by code. I just wonder, why it is necessary at
> all.
>
> Michael G. Schneider


--

Dave Peterson
 
Reply With Quote
 
Michael G. Schneider
Guest
Posts: n/a
 
      24th Sep 2007
"Dave Peterson" <(E-Mail Removed)> schrieb im Newsbeitrag
news:(E-Mail Removed)...
> Just my guess (I have no real knowledge of why MS does anything).
>
> I'm guessing that MS thought that if you were running excel via
> automation,
> then it wouldn't be a good idea to start all the addins (or files in the
> XLStart
> folder).
>
> Maybe they thought it would save time. Maybe they thought that there
> could
> be some user interaction that would have to be avoided (dismiss a message
> box???) in automation mode.


Doing anything in Automation should have the same results as if you did this
manually. Just imagine that you record some macros, and when you replay them
they don't work. You also expect anything done via code to be the same as if
done via keyboard.

Michael G. Schneider



 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      24th Sep 2007
If I were automating excel from another program, I may not want to have any
interaction with excel. I could keep the application hidden so that I (or the
other users) don't even know that excel is doing something in the background.

If I (or another user) had an addin that welcomed me to excel and waited for a
response, then my automated routine would never work.

And if I load those addins while I'm automating excel, then I can use the
recorded macros. But I'm glad MS made it the way they did. Otherwise, who
knows what kind of addins could be loaded and started--and any automated excel
procedure may not work as intended.

"Michael G. Schneider" wrote:
>
> Doing anything in Automation should have the same results as if you did this
> manually. Just imagine that you record some macros, and when you replay them
> they don't work. You also expect anything done via code to be the same as if
> done via keyboard.
>
> Michael G. Schneider


--

Dave Peterson
 
Reply With Quote
 
Michael G. Schneider
Guest
Posts: n/a
 
      24th Sep 2007
"Dave Peterson" <(E-Mail Removed)> schrieb im Newsbeitrag
news:(E-Mail Removed)...

> If I were automating excel from another program, I may not want to have
> any
> interaction with excel. I could keep the application hidden so that I (or
> the
> other users) don't even know that excel is doing something in the
> background.
>
> If I (or another user) had an addin that welcomed me to excel and waited
> for a
> response, then my automated routine would never work.
>
> And if I load those addins while I'm automating excel, then I can use the
> recorded macros. But I'm glad MS made it the way they did. Otherwise,
> who
> knows what kind of addins could be loaded and started--and any automated
> excel
> procedure may not work as intended.


Thanks a lot for the answer.

So, I understand that MS Excel never loads AddIns automatically, if Excel is
started by Automation. This is ok, if it always is that way. However, I
think during my tests I sometimes had situations, where the AddIns were
loaded automatically - but I will try to verify that.

Michael G. Schneider


 
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
Toosl/Templates & Addins - Checked items currently loaded =?Utf-8?B?U2hhcm9u?= Microsoft Word Document Management 1 1st Mar 2007 08:19 PM
if addin loaded on command line, it is not in addins collection scotty Microsoft Excel Programming 8 11th Jan 2007 05:51 PM
How to change the order in which excel addins gets loaded? =?Utf-8?B?Sm9zZXBo?= Microsoft Excel Misc 0 24th Jun 2005 07:56 AM
Re: Do the Addins belong to a workbook, or are they global to all workbooks loaded? Chip Pearson Microsoft Excel Programming 3 6th Aug 2003 11:01 PM
Re: how to programatically give assembly loaded from network the same trust as those loaded from local host? Marcelo Birnbach [MS] Microsoft Dot NET Framework 0 28th Jun 2003 12:51 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:03 AM.