473,547 Members | 2,354 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.InvalidC astException: Unable to cast COM object of type
'Microsoft.Offi ce.Interop.Exce l.ApplicationCl ass' to interface type
'Microsoft.Offi ce.Interop.Exce l._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_FILENOTF OUND)).
at Microsoft.Offic e.Interop.Excel .ApplicationCla ss.get_Workbook s()
at RunExcel.Form1. btnRunOutsideFo rm_Click(Object sender, EventArgs e) in
D:\FMI\Dev\NetP lay\VS2005\RunE xcel2003\RunExc el\Form1.vb:lin e 22
at System.Windows. Forms.Control.O nClick(EventArg s 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.Applicati on = New Excel.Applicati on
MessageBox.Show ("After Dim excelApp As Excel.Applicati on = New
Excel.Applicati on")

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

Wbk = excelApp.Workbo oks.Add()
MessageBox.Show ("After Wbk = excelApp.Workbo oks.Add()")

excelApp.Visibl e = True
MessageBox.Show ("After excelApp.Visibl e = True")

It bombs at Wbk = excelApp.Workbo oks.Add(). I've tried using
ApplicationClas s 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 4101

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

Similar topics

1
2574
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 versions of office. My questions are: 1. What is the 'best' practice for building an application that will work with both versions of office? Do...
4
4058
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). I have installed Office 2003 on my developemnt box.Will my application be able to read all kinds of Excell file (97-2000-2003)? Dose the wrapper...
2
12656
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 Microsoft.Office.Interop.Excel.ApplicationClass(); I keep getting this error: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed...
3
6219
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 I've added a reference to the COM Microsoft.Word 11 Object library and set the property Copy Local to true which created an interop assembly in my...
2
10918
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 Version 11.0.0.0 be installed in the Global Assembly Cache (GAC) first. Please contact your system administrator." Development PC: Windows 2000,...
11
20185
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 Vista? DETAILS: My setup: Dell Inspiron notebook with Vista Business edition My CD: Office 97 Professional (Service Release 1) Upgrade
2
4915
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 message in the environment shown here: Operating System: Microsoft Windows Version 5.1 (Build
15
5328
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 2003 application (Reports) works ok. But when Office 2003 is upgraded to Office 2007 Excel reports stops working. It Log the error “Exception...
0
1800
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 to Visual Basic .NET 2003. After converting the project, I dropped in my code from from the vb6 days, did a few slight modifications, refereneced...
0
7698
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7947
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7461
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7794
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6030
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5080
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3492
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1046
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
747
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.