QueryInterface, with the object Excel.Application

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dominique MILLOT

    QueryInterface, with the object Excel.Application

    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.Applicati on
    xapExcel = New Excel.Applicati on()
    xapExcel.Visibl e = False

    At the last line I obtain this error:
    "System.Invalid CastException: QueryInterface for interface
    Excel._Applicat ion 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.



  • Natty Gur

    #2
    Re: QueryInterface, with the object Excel.Applicati on

    Hi,
    Its better to use tlbimp when you use COM. here a detailed article of
    what you are looking for :


    Natty Gur, CTO
    Dao2Com Ltd.
    28th Baruch Hirsch st. Bnei-Brak
    Israel , 51114

    Phone Numbers:
    Office: +972-(0)3-5786668
    Fax: +972-(0)3-5703475
    Mobile: +972-(0)58-888377

    Know the overall picture


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!

    Comment

    • Dominique MILLOT

      #3
      Re: QueryInterface, with the object Excel.Applicati on

      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.


      Comment

      Working...