Programmatically Reading _AssemblyLocation From a VSTO Excel Workbook
Question
I've got a Visual Studio Excel Workbook project. When I publish the workbook and examine the source of the workbook (I open WinZip and check custom.xml), I see the tag _AssemblyLocation, which corresponds to the publish path.
Is there a way to read _AssemblyLocation from my .NET code?
I'd like to be able to read the publish path and determine which environment (development/quality assurance/production) I'm in based on server name.
Solution 2
The blog post, "How to get the Custom Properties of a Word Document using VSTO", provides a solution
OTHER TIPS
I guess you could open the xlsx using the ZipPackage class then read the XML using Xquery or xlinq etc.
http://msdn.microsoft.com/en-us/library/system.io.packaging.zippackage.aspx