Question

If i create a program, which in one small out of the way area, uses Excel automation:

will the application fail when Excel is needed

or will the application fail to start?


Update

Let me ask the same question, but in a more drawn out way:

Will the application be usable by

  • 99.9% of the users who never use the feature that requires Excel

  • 0% of the users, since Excel is not installed.

Let me ask the same question another way:

Will an application fail to initialize that references the COM interop dll's?


Let me ask the same question another way:

Will an application that doesn't use Excel, but references the COM interop DLL's fail to start?


Let me ask the same question another way:

Will an application that doesn't use Excel be usable if Excel is not installed, if that application has a dependancy on the Office Primary Interop dlls?


Let me ask the same question another way:

If my application doesn't use Excel, does the user have to have Excel installed?

Was it helpful?

Solution

The code will properly execute until it tries to make a call to the automation libraries, at that time it will generate an exception.

OTHER TIPS

I have an app that uses Excel automation and I can definitively say that it will fail at runtime, not at load time. In fact we check to see if it's even installed and only show the "Show data in Excel" button if we find it (but the PIAs are deployed to all installs).

If you automate Office... you gotta have Office!

Having said that, the answer changes if you twist the question into: Can I create an Excel spreadsheet without having Excel on the client?

There are many third-party controls to do this; you can write directly to the MS SpreadML XML spec (http://msdn.microsoft.com/en-us/library/aa140066(office.10).aspx; or use third-party libraries that do (like http://www.carlosag.net/Tools/ExcelXmlWriter/).

I think it will fail at runtime, because the Interop Assemblies should be able to load without the COM-Components available on the clients system.

UPDATE: Runtime should mean when you need it!

Using COM in Win32, it will fail when needed.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top