Its possibly im just missing something here but, when I write some code for Excel interop, here is how it goes.
- I add a reference to the Excel Com libraries.
- VS creates a PIA - Microsoft.Office.Interop.Excel....(via tlbimp right?).
- I copy the exe and the interop(PIA) dll to any machine (with .net) and it works?
Is there a scenario where I would have to deploy/register the PIA? Or have I got something wrong here, because it seems to me embedding the PIA into the main assembly doesn't seem like a great big feature?
Please excuse my ignorance, if any.
Update:
So I did some tests, I wrote an app that opens excel adds "hello" in a cell and saves the file.
I built it on my Win7 Dev machine with Office 2003 installed(So I referenced 2003 libs). Interestingly, without embedded PIA's the app is 9KB (The 3 PIA's total upto 1.32MB). With embedded PIA's the exe is 13KB.
Secondly, with embedded PIA, the app worked on a machine with Office 2007 and 2010. And without embedded PIA, on WinXP+Office2007 it failed only when the PIA's were not in the exe's directory.
So I guess whatever method, there is some kind of dynamic resolution? And then why did it work on a Win7 without the PIA's in the exe directory, but on WinXP it failed (only when the PIA's were not in the exe's dir), did the Win7 box have the PIA's prolly deployed globally or something?
Thanks
Gideon