473,395 Members | 1,442 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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
Apr 29 '07 #1
0 4081

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bob N5 | last post by:
I am working on an application that uses interop to do some simple operations with both Excel and Word. I have most of functionality working, but ran into issues on making things work with both...
4
by: J-T | last post by:
I'm trying to read an excell file in my .Net application using Office XP Primary Interop Assemblies (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnoxpta/html/odc_oxppias.asp)....
2
by: Alex D. | last post by:
Hi .I cant seem to find a way to authorize asp.net user to create an Excel application using this: Microsoft.Office.Interop.Excel.ApplicationClass excel = new...
3
by: Dustin van de Sande | last post by:
I'm developing a ASP.NET 2.0 web application which exports and imports Word documents. The functionality is implemented in a DLL project which is referenced by the web application. In the DLL...
2
by: Dean Slindee | last post by:
Getting the following message when doing a ClickOnce install at a deployment PC: "Unable to install or run the application. The application requires that assembly Microsoft.Office.Interop.Access...
11
by: Don | last post by:
QUESTIONS: 1. Has anyone figured out how to successfully install the Office 97 Pro Service Release 2 patch in Vista? 2. Has anyone successfully installed an Office 97 Pro CD (SR2 version) in...
2
by: Nicholas Dreyer | last post by:
The following error Run-time exception thrown : System.Runtime.InteropServices.COMException - Error loading type library/DLL. happens while running the code listed at the bottom of this...
15
by: =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?= | last post by:
Hi All, We are in the process of Upgrade Excel 2003 (Office 2003) to Excel 2007 (Office 2007) for one of web application. This web application is using Excel (Pivot Table) reports. With Excel...
0
by: TBass | last post by:
Hi, For years, I've been using visual basic and the Excel Object library version 9 and 10 to pass data back and forth between Visual Basic and Microsoft Excel. A few months ago, we changed over...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.