Hi Gurus,
I am having problem opening an excel file from vb.net. My code looks like
this:

Dim EXL as Excel.Application
Dim wrkbook As Excel.Workbook

EXL = GetObject("", "Excel.Application")
EXL = CreateObject("Excel.Application")
wrkbook = EXL.Workbooks.Open("D:\Book1.xls")

It works fine on my Dev box. But when I move to my test server where I don't
have dotnet IDE. All I have is .NET framework 1.1 and Excel XP (same as
Dev).

It seems to work fine until it creates EXL object but it fails on "wrkbook
= EXL.Workbooks.Open("D:\Book1.xls").
The error i get is "QueryInterface for interface Excel._Application failed".

I have Microsoft Excel 10.0 library set as reference..

Has anyone encountered same problem? Please help..

Thanks..

Re: QueryInterface for interface Excel._Application failed by Steve

Steve
Fri Dec 05 16:35:23 CST 2003

Here's an article that may be able to help:
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
Hire top-notch developers at http://www.able-consulting.com



"KC" <chhatra@hotmail.com> wrote in message
news:e1xN2r3uDHA.2712@TK2MSFTNGP11.phx.gbl...
> Hi Gurus,
> I am having problem opening an excel file from vb.net. My code looks like
> this:
>
> Dim EXL as Excel.Application
> Dim wrkbook As Excel.Workbook
>
> EXL = GetObject("", "Excel.Application")
> EXL = CreateObject("Excel.Application")
> wrkbook = EXL.Workbooks.Open("D:\Book1.xls")
>
> It works fine on my Dev box. But when I move to my test server where I
don't
> have dotnet IDE. All I have is .NET framework 1.1 and Excel XP (same as
> Dev).
>
> It seems to work fine until it creates EXL object but it fails on
"wrkbook
> = EXL.Workbooks.Open("D:\Book1.xls").
> The error i get is "QueryInterface for interface Excel._Application
failed".
>
> I have Microsoft Excel 10.0 library set as reference..
>
> Has anyone encountered same problem? Please help..
>
> Thanks..
>
>