S
Stephen Plotnick
I just loaded a new machine and vb 2008 and office 2007 are the same on both
machines. The program was written on VB 2005 but I had to upgrade to 2008
with vista on my old machine.
I have a vb program that reads a text file and creates a spreadsheet. The
program compiles clean but on my statement.
oexcel = CreateObject("Excel.Application")
System.InvalidCastException was unhandled
Message="Unable to cast COM object of type 'System.__ComObject' to class
type 'Microsoft.Office.Interop.Excel.ApplicationClass'. COM components that
enter the CLR and do not support IProvideClassInfo or that do not have any
interop assembly registered will be wrapped in the __ComObject type.
Instances of this type cannot be cast to any other class; however they can
be cast to interfaces as long as the underlying COM component supports
QueryInterface calls for the IID of the interface."
Source="mpt2007"
StackTrace:
at mpt2007.Module1.Main() in C:\Users\xxxxxx\Documents\Visual Studio
2005\Projects\mpt2007\mpt2007\Module1.vb:line 46 at
System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at
System.Threading.ExecutionContext.Run(ExecutionContext executionContext,
ContextCallback callback, Object state) at
System.Threading.ThreadHelper.ThreadStart()
InnerException:
My question is there something that is missing on my new machine that is
causing the issue??
machines. The program was written on VB 2005 but I had to upgrade to 2008
with vista on my old machine.
I have a vb program that reads a text file and creates a spreadsheet. The
program compiles clean but on my statement.
oexcel = CreateObject("Excel.Application")
System.InvalidCastException was unhandled
Message="Unable to cast COM object of type 'System.__ComObject' to class
type 'Microsoft.Office.Interop.Excel.ApplicationClass'. COM components that
enter the CLR and do not support IProvideClassInfo or that do not have any
interop assembly registered will be wrapped in the __ComObject type.
Instances of this type cannot be cast to any other class; however they can
be cast to interfaces as long as the underlying COM component supports
QueryInterface calls for the IID of the interface."
Source="mpt2007"
StackTrace:
at mpt2007.Module1.Main() in C:\Users\xxxxxx\Documents\Visual Studio
2005\Projects\mpt2007\mpt2007\Module1.vb:line 46 at
System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at
System.Threading.ExecutionContext.Run(ExecutionContext executionContext,
ContextCallback callback, Object state) at
System.Threading.ThreadHelper.ThreadStart()
InnerException:
My question is there something that is missing on my new machine that is
causing the issue??