Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default InvalidCastException with .NET

Hi,

I am trying to access Excel from .NET. Initially it was working fine. But
after sometime it is giving the exception, 'System.InvalidCastException:
QueryInterface for interface Microsoft.Office.Interop.Excel._Application
failed'. I tried reinstalling PIAs and Excel, but nothing worked.

I installed PIA's in the GAC.
I am using Excel 2002 SP-2 and VS 2003.

Thanks for your help.

-Samba

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default InvalidCastException with .NET

You typically get this sort of exception with incompatible types. Is this
coming from code you wrote or from the OS? In the former, post the code. If
it's the latter, you will need to do some uninstalling and installing to
clear the issue.

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc
"Samba" wrote in message
...
Hi,

I am trying to access Excel from .NET. Initially it was working fine. But
after sometime it is giving the exception, 'System.InvalidCastException:
QueryInterface for interface Microsoft.Office.Interop.Excel._Application
failed'. I tried reinstalling PIAs and Excel, but nothing worked.

I installed PIA's in the GAC.
I am using Excel 2002 SP-2 and VS 2003.

Thanks for your help.

-Samba



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default InvalidCastException with .NET

Hi,
I think it is coming from OS. Same code was working fine. It works even now
in other servers. About uninstalling and installing, do you know any
details. Meaning what components and which order. Could you help me?

Thanks,
-Samba

"Alvin Bruney [MVP - ASP.NET]" wrote:

You typically get this sort of exception with incompatible types. Is this
coming from code you wrote or from the OS? In the former, post the code. If
it's the latter, you will need to do some uninstalling and installing to
clear the issue.

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc
"Samba" wrote in message
...
Hi,

I am trying to access Excel from .NET. Initially it was working fine. But
after sometime it is giving the exception, 'System.InvalidCastException:
QueryInterface for interface Microsoft.Office.Interop.Excel._Application
failed'. I tried reinstalling PIAs and Excel, but nothing worked.

I installed PIA's in the GAC.
I am using Excel 2002 SP-2 and VS 2003.

Thanks for your help.

-Samba




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default InvalidCastException with .NET

Samba,

I'm having the same issues in a web farm, it works fine on 2 servers
but I get that error on the 3rd server. Did you ever find a
solution....what needed uninstalling and reinstalling and the order?

Richard.
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default InvalidCastException with .NET

Hi,

No. I could not find any solution so far. I re-installed all related s/w's.
But no use. My guess is that, I may have to change something in registry. But
I did not find which one. I will post it here, if I find any thing.


-Samba

"Richard Kitson via OfficeKB.com" wrote:

Samba,

I'm having the same issues in a web farm, it works fine on 2 servers
but I get that error on the 3rd server. Did you ever find a
solution....what needed uninstalling and reinstalling and the order?

Richard.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"