QueryInterface for interface Excel._Application failed

  • Thread starter Michael Connerton
  • Start date
M

Michael Connerton

The company I work for still uses Excel97. In a weaker moment I added the pia for Excel2003 in attempt to get more programatic functionality out of some Excel interfaces I have been writing. The pia is entitled 'Microsoft.Office.Interop.Excel.dll' I also added the registry entries for that pia by running 'Microsoft.Office.Interop.Excel.dll.reg.' After performing that stunt the following code consistantly fails on the second line

excelApp = new Excel.ApplicationClass()
excelApp.Visible = true

I can declare the new 'Excel.ApplicationClass(). Unfortunately every time I run 'excelApp.Visible = true' my program fails with the error

'QueryInterface for interface Excel._Application failed.

I have since manually removed 'Microsoft.Office.Interop.excel.dll.' The automatic removal of that pia failed. I have painstakingly removed the registry entries for the same. Can anyone explain what it is that I have failed to remove? Is it possible that I need to add something back into the registry for the Excel97.dll to run properly? If so what is that something. Thank you for any assistance you may be able to provide.
 
S

Steve C. Orr [MVP, MCSD]

This article should help you get your Excel code working one way or another:
http://www.aspnetpro.com/NewsletterArticle/2003/09/asp200309so_l/asp200309so_l.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net


Michael Connerton said:
The company I work for still uses Excel97. In a weaker moment I added the
pia for Excel2003 in attempt to get more programatic functionality out of
some Excel interfaces I have been writing. The pia is entitled
'Microsoft.Office.Interop.Excel.dll' I also added the registry entries for
that pia by running 'Microsoft.Office.Interop.Excel.dll.reg.' After
performing that stunt the following code consistantly fails on the second
line:
excelApp = new Excel.ApplicationClass();
excelApp.Visible = true;

I can declare the new 'Excel.ApplicationClass(). Unfortunately every time
I run 'excelApp.Visible = true' my program fails with the error:
'QueryInterface for interface Excel._Application failed.'

I have since manually removed 'Microsoft.Office.Interop.excel.dll.' The
automatic removal of that pia failed. I have painstakingly removed the
registry entries for the same. Can anyone explain what it is that I have
failed to remove? Is it possible that I need to add something back into the
registry for the Excel97.dll to run properly? If so what is that something.
Thank you for any assistance you may be able to provide.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top