Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problem in making Excel.WorkBook from VB.NET

I made an application in Vb.NET that loads an excel application and then
start to generate some reports on it, my problem is:

1 - the application was running with no problems and after formatting my PC,
installing Windows XP, SP2, Office 2003 + SP1, Visual studio 2003 and start
running the program it succeeded in making an excel application object, but
it faild to create a workbook or any other feature or property, except
"ExcelApp.Visible=True".

2 - when I start to debug the code, it gives me the following error " Old
format or Invalid Type Library"

3 - I checked my refrences and found that there is no problem, the
application compiles with no errors.

4 - I made my refrences by adding a refrence to excel.exe file into my
project and it adds automatically "Microsoft.Office.Core" refrence and
"VBIDE" refrence to my project.

I have tried to format my PC again and install office again and test, but it
still gives me the same error.

I have tested it on another PCs(3 different PCs) and it worked fine and
correctly with no problem

what does this error message mean?
What is its cause?
is there anything that I did not take care of after format?
what should I do in order to avoid this error message?


here is the code snippit that makes the problem:

Dim ExcelApp As Excel.Application
ExcelApp = CreateObject("Excel.Application")
ExcelApp.Visible = True

Dim WB As Excel.Workbook
WB = ExcelApp.Workbooks.Add ' <==== Here Where it Crashs and give me
the error message " Old format or Invalid Type Library"



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Problem in making Excel.WorkBook from VB.NET

Wael_Bakr,
This VB.Net code ?
Look a lot like VB6 to me. Does Vb.Net use all that Interop stuff ?

NickHK


"Wael_Bakr" wrote in message
...
I made an application in Vb.NET that loads an excel application and then
start to generate some reports on it, my problem is:

1 - the application was running with no problems and after formatting my

PC,
installing Windows XP, SP2, Office 2003 + SP1, Visual studio 2003 and

start
running the program it succeeded in making an excel application object,

but
it faild to create a workbook or any other feature or property, except
"ExcelApp.Visible=True".

2 - when I start to debug the code, it gives me the following error " Old
format or Invalid Type Library"

3 - I checked my refrences and found that there is no problem, the
application compiles with no errors.

4 - I made my refrences by adding a refrence to excel.exe file into my
project and it adds automatically "Microsoft.Office.Core" refrence and
"VBIDE" refrence to my project.

I have tried to format my PC again and install office again and test, but

it
still gives me the same error.

I have tested it on another PCs(3 different PCs) and it worked fine and
correctly with no problem

what does this error message mean?
What is its cause?
is there anything that I did not take care of after format?
what should I do in order to avoid this error message?


here is the code snippit that makes the problem:

Dim ExcelApp As Excel.Application
ExcelApp = CreateObject("Excel.Application")
ExcelApp.Visible = True

Dim WB As Excel.Workbook
WB = ExcelApp.Workbooks.Add ' <==== Here Where it Crashs and give

me
the error message " Old format or Invalid Type Library"





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problem in making Excel.WorkBook from VB.NET


I was feeling quite confident about the answer until you said it worked
on other pcs.

I am not sure why you need a reference to the IDE but you may do, what
you haven't mentioned is a reference to the excel object reference
library.

You do need to make sure that you pick up compatible sets of libraries
otherwise you will be trying to operate on an object with two different
versions of EXCEL. Which what I suspect your error is indicating.

Hope this helps


--
tony h
------------------------------------------------------------------------
tony h's Profile: http://www.excelforum.com/member.php...o&userid=21074
View this thread: http://www.excelforum.com/showthread...hreadid=502392

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
Excel is crashing when making a pdf of my workbook Jewell Excel Worksheet Functions 0 August 27th 09 02:24 PM
Excel - making changes in one workbook so they affect other workbo fiona2009 Excel Discussion (Misc queries) 0 April 29th 09 09:47 PM
Excel edit problem, (of my own making!!) John K Excel Discussion (Misc queries) 4 May 24th 06 05:52 PM
Problem making versions of a table by changing sourse data in another workbook Dmitry Kopnichev Links and Linking in Excel 4 April 1st 05 06:44 AM
Problem making versions of a table by changing sourse data in another workbook Dmitry Kopnichev Excel Discussion (Misc queries) 4 April 1st 05 06:44 AM


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