Dynamically attach an assembly to an Excel File

Hello

I have the follwing problem.
I have a VSTO 2005 smart document for Excel that will be deployed on a web share.
This assembly should be accessed by excel files.
As far as I understood I should use clickonce to do that, and dynamically load my dependent assemblies when the application starts, to make them present in the IE cache for offline working.

But I have a complication: the Excel file does not exists, nor does a template for this file.
This File is generated by a tool on a server and then downloaded by the user. I have the power to make changes to the created file on the server.

I want to dynamically link the created file to the assembly I created.

In VSTO2003 this was possible by changing the name and the path of the assembly in the excel file properties.

But what to do with VSTO2005, as these properties are respectivelly a "*" and a GUID which I don't know the meaning.

How to link my assembly dynamically? This is a blocking problem for me ....

Thanks a lot for your help

[1027 byte] By [Kerad] at [2007-12-17]
# 1
In VSTO2005 you can use the ServerDocument object model to attach the assembly to the document. ServerDocument.AddCustomization(...) method will perform all required steps for this.

HTH.

MohitGupta-MSFT at 2007-9-8 > top of Msdn Tech,Visual Studio Tools for Office,Visual Studio Tools for Office...
# 2
Hi, thanks for your answer.
This solution works fine.

But my problem is a bit deaper :-]
In fact, I do not create the Excel file, only the SmartDocument.

The excel file is created using an ActiveX by an external tool. The programmers of this tool can add some code to attach the SmartDocument before i get it, BUT they do not use .NET ... they use some kind of ActiveX accessing Office API.

I know that in VSTO2003 you had to change the custom properties AssemblyPath and AssemblyName.
But is VSTO2005 these values are "*" and a GUID.

Is there a "non .net but Office" way ;) to handle the attachement of an Excel file to the SmartDocument?

Thanks a lot :)

Kerad

Kerad at 2007-9-8 > top of Msdn Tech,Visual Studio Tools for Office,Visual Studio Tools for Office...
# 3
Hello,

In addition to using the ServerDocument.AddCustomization method as Mohit mentioned above, you can also use the custom document properties to attach the assembly to the Excel document. For more information about both options, please see the following topic in the Visual Studio 2005 Tools for Office documentation:

http://msdn2.microsoft.com/library/ms268877(en-US,VS.80).aspx

I hope this helps,
McLean Schofield

McLeanSchofield-MSFT at 2007-9-8 > top of Msdn Tech,Visual Studio Tools for Office,Visual Studio Tools for Office...
# 4
Thanks a lot, that was what I was looking for.
Problem 1 of 3 solved :-]
Kerad at 2007-9-8 > top of Msdn Tech,Visual Studio Tools for Office,Visual Studio Tools for Office...