Daven Patel

When deploying an .NET application that uses Microsoft Excel, how do I check for the existence of Excel on the machine before starting the program The issue lies in that the project I am working on references the Microsoft Office interop assemblies and I need a way to check if they exist before starting the application.




Re: Visual Studio Tools for Office Office Interop Assemblies

Douglas H. Troy

Well, we'd need to know if you're using Office 2003 or 2007 ... if you're using 2003, then you'll want to look into implementing AppCheck and PIACheck. You can obtain copies from Mad's Blog http://weblogs.asp.net/mnissen/archive/2006/05/03/444927.aspx

If you're using Office 2007, AppChecka and PIACheck won't work; however, one way you can check the registry key HKEY_CLASSES_ROOT\Excel.Application\CurVer, which would be set to Excel.Application.12

As far as making sure the PIAs for 2007 are installed, search these groups, someone has posted a reg key you can check for that as well ...

Hope that helps.






Re: Visual Studio Tools for Office Office Interop Assemblies

Daven Patel

The users will either be using Office 2003 or Office XP.




Re: Visual Studio Tools for Office Office Interop Assemblies

Douglas H. Troy

Then you can safely implement AppCheck and PIACheck (as I indicated in my previous post). Just snag the compiled files from Mad's blog.

The MSDN VSTO Deployment guide discusses using both of these ... you can find links to the deployment guide in the "Read me First" thread at the top of this forum.

If you have other questions, let us know.