Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
dont overwrite excel 2003 when installing office 2007 | Excel Discussion (Misc queries) | |||
dont delete excel 2003 when installing office 2007 | Setting up and Configuration of Excel | |||
Interop.Excel version 11 does not work with Office 2003 sp2 | Excel Programming | |||
Problem sharing spreadsheet between Office10 (Office XP) and Office 11 (Office 2003) | Excel Programming |