Deploying Excel COM Addin

  • Thread starter Peter Karlström
  • Start date
P

Peter Karlström

Hi

I have just tested an Excel COM Addin with UDF (User Defined Functions) in
Excel 2003. The COM Addin is created with VB6.
I followed the #2 solution which was provided by Jialiang Ge in the thread
Excel Documentproperties (2007-11-05).
The solution was described in the KB-articel
http://support.microsoft.com/kb/285337
Everything works fine.

Now its time for deployment, but I can't find any registry entry for the
Excel Automation Addin.

How is this solution deployed?

Thanks in advance
 
J

Jialiang Ge [MSFT]

Hello Peter

From your post, my understanding on this issue is: you wonder how to
distribute a Office COM Add-in created with Visual Basic 6.0. If I'm off
base, please feel free to let me know.

When VB Addin designer compile the automation addin and build the DLL, it
automatically register the DLL for us. The registry subkey is
\HKEY_CURRENT_USER\Software\Microsoft\Office\appname\AddIns. The
*Description* entry is your setting for the *Addin Description* option in
the add-in designer. The *FriendlyName* entry is your setting for the
*Addin Display name* option in the designer.
(http://msdn2.microsoft.com/en-us/library/aa155767(office.10).aspx) Add-ins
that are registered under HKEY_CURRENT_USER apply to that user only;
Add-ins that are registered under HEY_LOCAL_MACHINE are global to the
system and load for all instances of that application
(http://msdn2.microsoft.com/en-us/library/aa155767(office.10).aspx). The VB
add-in designer is written to build per-user add-ins. If it is to be built
for all the users, see:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;290868

Now, for your question about how to distribute a Office COM Add-in created
with Visual Basic 6.0, please refer to the MSDN article:
http://msdn2.microsoft.com/en-us/library/aa140987(office.10).aspx
According to the article, the easiest way to distribute a COM add-in is to
include the add-in designer in the Add-in project and then create a setup
program for the add-in. The user can install and register the add-in by
running the setup program. To create the setup program, run the Visual
Basic 6.0 Package and Deployment Wizard on the Add-in project. When the
user runs the setup program, all the files required for the add-in to run
will be copied to the user's computer and registered. As for the Visual
Basic 6.0 Package and Deployment Wizard, here are some related articles for
your reference:

Get Started with the Package and Deployment Wizard (PDW)
http://support.microsoft.com/default.aspx?scid=/support/vbasic/gettingstarte
d/pdw.asp&SD=MSDN

Best practices for deploying Visual Basic 6.0 applications
http://support.microsoft.com/kb/830761

Frequently asked questions about the Package and Deployment Wizard in
Visual Basic 6.0
http://support.microsoft.com/kb/885484

Last but not least, I hope to let you know that Visual Basic 6 is currently
in its Extended Phase support. According to
http://msdn2.microsoft.com/en-us/vbrun/ms788707.aspx, Visual Basic 6.0 will
no longer be supported starting March 2008.

If you have any other concern or need anything else, please feel free to
let me know.

Sincerely,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
For MSDN subscribers whose posts are left unanswered, please check this
document: http://blogs.msdn.com/msdnts/pages/postingAlias.aspx

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications. If you are using Outlook Express/Windows Mail, please make sure
you clear the check box "Tools/Options/Read: Get 300 headers at a time" to
see your reply promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
P

Peter Karlström

Hi

It's not the deployment of the COM Addin itself. Rather the settings in
Excel, which is explained in the kb-article.
In the article (http://support.microsoft.com/default.aspx/kb/285337) with
the heading "Using the Sample Automation Add-in in Microsoft Excel 2002 or
Microsoft Office Excel 2003", they describe how you manually load this Addin
via the Automation button on the Tools - Addins dialog.
We intend to deploy this solution to +200 users and we don't want them to
the final pieces themselves.

I have tried monitoring the Registry when I load/activate the Addin, but
nothing seems to get set in the "Excel-areas".

If I create an install program with the Deployment Wizard, the activation of
the
Addin in Excels Add-in manager will not be included.

So, how do I do this?

Thanks in advance

--
Peter Karlström
Midrange AB
Sweden
 
J

Jialiang Ge [MSFT]

Hello Peter,

Sorry for my misunderstanding of the question in the very beginning.
According to the KB article http://support.microsoft.com/kb/291392,
automation Add-ins, compared with COM add-ins, are always loaded on demand.
That is to say, we recommend that users should manually enable/activate the
automation add-ins that they are really in need of. However, if you insist
on automatically activate the Automation Add-in when Excel is loaded, there
is an undocumented method to do that for your reference:

According to the section "Automation Add-ins" in
http://support.microsoft.com/kb/291392, when you make additions to the list
in the Add-Ins dialog box or when you select and clear Add-ins in the list,
Excel stores your changes in the registry. First, Excel uses the following
registry setting to determine whether or not an Automation Add-in in the
Add-in list is loaded:
Key: HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Excel\Options String:
OPENx Sample Value: /A "ServerName.ClassName"
Here, 'x' in OPENx is an id to differentiate between multiple OPENs. For
instance, suppose we have two Excel Automation Add-ins
(AutomationAddin.XLFunctions and AutomationAddin.XLFunctions2) that have
been activated, then we will find two OPEN entries in the registry:
HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Excel\Options
OPEN /A "AutomationAddin.XLFunctions"
OPEN1 /A "AutomationAddin.XLFunctions2"

Therefore, if we want to activate the Automation Add-in automatically, what
we need to do is to add an entry of OPEN (be careful about the x) in the
registry:
HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Excel\Options
when the add-in is installed. That is to say, we should customize the setup
project to write the registry key.

Please feel free to let me know if you have any other question or need
anything else. If you encounter some problems when building the setup
project, you could post the question in Microsoft.public.vsnet.setup or
public.platformsdk.msi newsgroup. Experts on 'setup' from Microsoft will
help you with it.

Sincerely,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from your issue.
=================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
P

Peter Karlström

Hi

This was exactly what I was after. Now I know how to handle the
deployment.

One final question though:
Is this behavior for Current User only, or is there a way to set this up
for Local Machine?

Regards
--
Peter Karlström
Midrange AB
Sweden
 
J

Jialiang Ge [MSFT]

Hello Peter,

Based on my test, we set it for local machine by add the registry entry
under
HKEY_LOCAL_MACHINE\Software\Microsoft\Office\11.0\Excel\Options.

But please note that we do not recommend to do so because it is not a
supported/documented behavior in Office system. There might be some
unpredictable issues that we do not know.

Sincerely,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from your issue.
=================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
P

Peter Karlström

Hi Jialiang Ge

Thanks you very much for all your help.

I will let the customer deside which way to go about the registry settings,
but I will give them the pros and cons as you have described to me.

Regards
--
Peter Karlström
Midrange AB
Sweden
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top