Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

old version ofexell problem

Status
Not open for further replies.

skarosi

Programmer
Jan 25, 2004
140
GR
Dear all,
I wrote a programm in VB .NET using an excell file, recently i upgrade my office from xp to 2003, and now that i tried to run my program once again i get astrange error

"An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in CdDataBase.exe

Additional information: Old format or invalid type library."
at this line:
wsheet = exl.Workbooks.Open("c:\file.xml").Worksheets.Item(1)
I tried to save the file as an older cversion of excell and also to change the COM reference to the new version, but both with no results:(
can you please help me?
Thank you
 
The CCW that you created when you set a reference to the Excel libraries in your project was tied to the specific version of Excel. When you changed versions of Excel, your program could no longer find the COM library it was created against.

You'll need to create a new CCW (reset your reference in your VB.NET project) and recompile.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Yep and since they were so kind to change the whole thing in 2003. You will need to change some aswell.

For example the imports thingie will be different. It will no longer be imports excell.

But more something int the line of imports. microsoft.office.excell.


Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
Chip, by saying reset my reference in VB u mean to change the COM from the "add reference"? I did that and it still didnt compile.
i dont use import nowere on my code Christiaan, what other part should i change?
Thank you both!
Ilias(GR)
 
how do you inatiate the exl object.

something like

dim exl as new excell.application

then you need to change that to

dim exl as new microsoft.office.excell.application

or something like that

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
yes, that is exactly how i used it. i just thought that u r talking about an "initialise" codeword.
i used this but i get an "not defined" error!
God! why they have to change all these in just a version upgrade!
do u know how i can find out the proper line?
thanks
 
do an imports then type microsoft then the point and then the intellisense should kick in and help you on your way. Smart thing that intelisense.

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
i tried to do this, but i get this: Microsoft.charp(OR)Office(OR)Office(OR)Win32, i choose office and i get only Core, so it is Microsoft.Office.Core!
What is this?!
thanks anyway
 
I'm pretty sure it should be this

Microsoft.Office.Interop.excell.Application

that is offcourse if you have the reference set to the

"Microsoft Excell 11.0 Object Library"

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
I have tried the line u just gave me and i get this error:
Type "Microsoft.Office.Interop.excell.Application" is not defined.
I have added a reference for Excell 11, and as i see on the references tree there is one entry of "Microsoft office Core" which i have no idea what it is.
I think that i wont b able to solve this, but thanks anyway
 
Actually no, except the thing where i use officeXP and not 03 :D
do u have any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top