QueryInterface, with the object Excel.Application

  • Thread starter Thread starter Dominique MILLOT
  • Start date Start date
D

Dominique MILLOT

Hello,

With Asp.Net, I try to generat a document with an Excel object.

This is the begin of my procedure:
Dim xapExcel As Excel.Application
xapExcel = New Excel.Application()
xapExcel.Visible = False

At the last line I obtain this error:
"System.InvalidCastException: QueryInterface for interface
Excel._Application failed."

Other clues:
- I have granted AspNet to run Excel (with the tool DComCnfg.exe).
- I use Office XP in english, but the Os and .Net was in french. I have make
some tests without succes by changing CurrentCulture.

Someone have a solution ?

Regards.
 
Thanks for your answer;

tlbimp was certainly usefull for Excel 5, 2000.
But I think we didn't need it for Office XP (2002)

And in add, it was recommanded on every doc I find for C and not for VB.

(Or I didn't understand tlbimp use)

Regards.
 
Back
Top