Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Problem with Interop.Excel after uninstalling Office 2007 and installing Office 2003

I am developing a VB.Net application with VS 2005 that opens an Excel
workbook and populates the worksheet with data. I started developing the
application with Office 2007 installed on my Vista OS, but after I
discovered that it won't run on a system with Office 2003, I uninstalled
Office 2007 and installed Office 2003. I reset the reference in .Net to the
Microsoft Excel 11.0 Object Library. The application works fine from the
..Net IDE but when I compile and run the .Exe I get the following error
message:

************** Exception Text **************
System.InvalidCastException: Unable to cast COM object of type
'Microsoft.Office.Interop.Excel.ApplicationClass' to interface type
'Microsoft.Office.Interop.Excel._Application'. This operation failed because
the QueryInterface call on the COM component for the interface with IID
'{000208D5-0000-0000-C000-000000000046}' failed due to the following error:
could not be found. (Exception from HRESULT: 0x80030002
(STG_E_FILENOTFOUND)).
at Microsoft.Office.Interop.Excel.ApplicationClass.ge t_Workbooks()
at RunExcel.Form1.btnRunOutsideForm_Click(Object sender, EventArgs e) in
D:\FMI\Dev\NetPlay\VS2005\RunExcel2003\RunExcel\Fo rm1.vb:line 22
at System.Windows.Forms.Control.OnClick(EventArgs e)

This did not occur with the original Office 2007 installation. I've tried
running Office repair, uninstalling and reinstalling Excel .Net program
support from the Office installation, but none of this works. The exe works
on my test platform running WinXP and Office 2003 (clean installation where
Office 2007 was never installed).

It makes no difference whether Option Strict is on or off. The code is
simple:

Dim excelApp As Excel.Application = New Excel.Application
MessageBox.Show("After Dim excelApp As Excel.Application = New
Excel.Application")

Dim Wbk As Excel.Workbook
MessageBox.Show("After Dim Wbk as Excel.Workbook")

Wbk = excelApp.Workbooks.Add()
MessageBox.Show("After Wbk = excelApp.Workbooks.Add()")

excelApp.Visible = True
MessageBox.Show("After excelApp.Visible = True")

It bombs at Wbk = excelApp.Workbooks.Add(). I've tried using
ApplicationClass and CreateObject but none of that works either.

Anyone know how to fix this short of reinstalling the entire operating
system?

Thanks,

Bill

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Problem with Interop.Excel after uninstalling Office 2007 and installing Office 2003


Bill,
Try removing the parentheses after .add
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Bill F"
wrote in message
I am developing a VB.Net application with VS 2005 that opens an Excel
workbook and populates the worksheet with data. I started developing the
application with Office 2007 installed on my Vista OS, but after I
discovered that it won't run on a system with Office 2003, I uninstalled
Office 2007 and installed Office 2003. I reset the reference in .Net to the
Microsoft Excel 11.0 Object Library. The application works fine from the
..Net IDE but when I compile and run the .Exe I get the following error
message:

************** Exception Text **************
System.InvalidCastException: Unable to cast COM object of type
'Microsoft.Office.Interop.Excel.ApplicationClass' to interface type
'Microsoft.Office.Interop.Excel._Application'. This operation failed because
the QueryInterface call on the COM component for the interface with IID
'{000208D5-0000-0000-C000-000000000046}' failed due to the following error:
could not be found. (Exception from HRESULT: 0x80030002
(STG_E_FILENOTFOUND)).
at Microsoft.Office.Interop.Excel.ApplicationClass.ge t_Workbooks()
at RunExcel.Form1.btnRunOutsideForm_Click(Object sender, EventArgs e) in
D:\FMI\Dev\NetPlay\VS2005\RunExcel2003\RunExcel\Fo rm1.vb:line 22
at System.Windows.Forms.Control.OnClick(EventArgs e)

This did not occur with the original Office 2007 installation. I've tried
running Office repair, uninstalling and reinstalling Excel .Net program
support from the Office installation, but none of this works. The exe works
on my test platform running WinXP and Office 2003 (clean installation where
Office 2007 was never installed).
It makes no difference whether Option Strict is on or off. The code is
simple:

Dim excelApp As Excel.Application = New Excel.Application
MessageBox.Show("After Dim excelApp As Excel.Application = New
Excel.Application")
Dim Wbk As Excel.Workbook
MessageBox.Show("After Dim Wbk as Excel.Workbook")

Wbk = excelApp.Workbooks.Add()
MessageBox.Show("After Wbk = excelApp.Workbooks.Add()")

excelApp.Visible = True
MessageBox.Show("After excelApp.Visible = True")
It bombs at Wbk = excelApp.Workbooks.Add(). I've tried using
ApplicationClass and CreateObject but none of that works either.
Anyone know how to fix this short of reinstalling the entire operating
system?
Thanks,
Bill

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Problem with Interop.Excel after uninstalling Office 2007 and installing Office 2003

I tried removing the parentheses after the .Add but this did not solve the
problem.

Thanks for the suggestion.

Major Frustrated Bill

"Jim Cone" wrote in message
...

Bill,
Try removing the parentheses after .add
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Bill F"
wrote in message
I am developing a VB.Net application with VS 2005 that opens an Excel
workbook and populates the worksheet with data. I started developing the
application with Office 2007 installed on my Vista OS, but after I
discovered that it won't run on a system with Office 2003, I uninstalled
Office 2007 and installed Office 2003. I reset the reference in .Net to
the
Microsoft Excel 11.0 Object Library. The application works fine from the
.Net IDE but when I compile and run the .Exe I get the following error
message:

************** Exception Text **************
System.InvalidCastException: Unable to cast COM object of type
'Microsoft.Office.Interop.Excel.ApplicationClass' to interface type
'Microsoft.Office.Interop.Excel._Application'. This operation failed
because
the QueryInterface call on the COM component for the interface with IID
'{000208D5-0000-0000-C000-000000000046}' failed due to the following
error:
could not be found. (Exception from HRESULT: 0x80030002
(STG_E_FILENOTFOUND)).
at Microsoft.Office.Interop.Excel.ApplicationClass.ge t_Workbooks()
at RunExcel.Form1.btnRunOutsideForm_Click(Object sender, EventArgs e) in
D:\FMI\Dev\NetPlay\VS2005\RunExcel2003\RunExcel\Fo rm1.vb:line 22
at System.Windows.Forms.Control.OnClick(EventArgs e)

This did not occur with the original Office 2007 installation. I've tried
running Office repair, uninstalling and reinstalling Excel .Net program
support from the Office installation, but none of this works. The exe
works
on my test platform running WinXP and Office 2003 (clean installation
where
Office 2007 was never installed).
It makes no difference whether Option Strict is on or off. The code is
simple:

Dim excelApp As Excel.Application = New Excel.Application
MessageBox.Show("After Dim excelApp As Excel.Application = New
Excel.Application")
Dim Wbk As Excel.Workbook
MessageBox.Show("After Dim Wbk as Excel.Workbook")

Wbk = excelApp.Workbooks.Add()
MessageBox.Show("After Wbk = excelApp.Workbooks.Add()")

excelApp.Visible = True
MessageBox.Show("After excelApp.Visible = True")
It bombs at Wbk = excelApp.Workbooks.Add(). I've tried using
ApplicationClass and CreateObject but none of that works either.
Anyone know how to fix this short of reinstalling the entire operating
system?
Thanks,
Bill


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
dont overwrite excel 2003 when installing office 2007 Xavier[_2_] Excel Discussion (Misc queries) 3 January 25th 08 08:14 PM
dont delete excel 2003 when installing office 2007 Xavier[_2_] Setting up and Configuration of Excel 2 January 25th 08 07:32 AM
Interop.Excel version 11 does not work with Office 2003 sp2 Hua Huang Excel Programming 3 November 22nd 05 09:36 PM
Problem sharing spreadsheet between Office10 (Office XP) and Office 11 (Office 2003) Sage Solutions Group Excel Programming 0 August 20th 04 08:58 PM


All times are GMT +1. The time now is 10:38 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"