views:

72

answers:

1

I have a solution containing an VSTO Excel AddIn project and an VSTO Excel Template project. Is there any design pattern (or hack) that can allow the ThisAddIn instance to access properties and methods of the ThisWorkbook instance, and vice versa?

Also I should note that I'm using VS 2008, VSTO 2005SE, and the target Office version is 2003.

A: 

Addins are workbooks, as far as Excel is concerned. So if you reference thisworkbook in the addin code you are referring to the addin.

You can always refer to other excel files but you generally have to know the name of the file (or be able to derive based on which workbooks are open).

guitarthrower
I should have mentioned these are VSTO projects. The ThisAddIn class and ThisWorkbook classes do differ from one another. Sorry for not having clarified this sooner.
code4life