System.InvalidCastException on create Excel.Application obj after installing Office XP PIA
Posted on 2003-12-11
Im writing a VB.Net app that automates Excel 2000. I found the Office xp interop and installed it on my machine (note: I do not have office xp) oxppia.exe. So after installing this, now I find that my app throws a System.InvalidCastException error on this line of code:
xlApp = CType(CreateObject("Excel.Application"), Excel.Application)
Which had been working for days before I installed the interop. In hindsite, I guess maybe it was dumb to install the interop when I dont
have Office xp, but I couldnt clearly discearn that it would not work with office 2000.
Ive got the idea, that my gac is messed up now, I tried to uninstall the interop assemblies that I had just added into the gac,
but only 2 of the 4 would uninstall.
Office and StdOle would not allow removal. ( I was using gacutil /u, and tried gacutil /uf)
Any help would be most welcome.