473,416 Members | 1,683 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,416 software developers and data experts.

Invalid Sheet Name in Excel 2003

Hello All,
We have a VB.NET application writen using VS 2003. This application apens an
excel file from a vendor, reads the data and performs whatever functions it
needs. We recently upgraded our sytems to Excel 2003 from Excel 2000. Our
application started erroring out because it was having a problem with opening
the Excel file.

From troubleshooting, the exact problem is in Excel 2003, it does not like
the sheet name (even though the sheet name is "sheet1"). When I open the
Excel file from my vendor using Excel 2003, I get a message box that says
"Errors were detected in 'ExcelName.xls', but Microsoft Office Excel was able
to open the file by making the repairs listed below. Save teh file to make
these reapis pernament."

Renamed invalid sheet name.

This is fine, if opening up Excel on your own, but our application is a
stand alone application that runs everyday, opens a new excel file, performs
its actions, and closes.

With Excel 2003, Our application gets as far as opening, and then errors our
with a message of: "Object reference not set to an instance of an object."
because it cannot open the file due to the error being passed back.

Is there a programmatic way around this error?

Here is my code for opening the Excel File:
Public xlApp As Object
Public xlbook As Object
Public xlsheet As Object

xlApp = CreateObject("Excel.Application")
xlbook = xlApp.Workbooks.Open(OpenFileName) <-- errors here
xlsheet = xlbook.Worksheets.Item(1)

The only solution I can come up with is, uninstall Excel 2003 from my
computer that the application is running on, and re-install Excel 2000. I
would rather try and come up with a solution to the Excel 2003 problem.

Thank you in advance for your help.

Lyners
Jun 27 '08 #1
4 3959
"Lyners" <Ly****@discussions.microsoft.comschrieb
Renamed invalid sheet name.

Have not much experience in this area but searching for "Renamed in
valid sheet name" finds some links, however not all helpful.

This might give an explanation:
http://groups.google.com/group/micro...ac8b1cf62d9ccd

Try this

xlbook = xlApp.Workbooks.Open(OpenFileName, corruptload := <value>)

I think adding CorruptLoad will crash in Excel 2000 and earlier. So, I'd
try it without CorrupLoad, first. If it fails, add it. If it fails again
there is another problem.

Here you find what <valuecan be:
http://msdn.microsoft.com/en-us/libr...ffice.10).aspx
As you don't have a COM automation reference to Excel, you'd probably
have to add the constants (xlNormalLoad, xlRepairFile and xlExtractData)
on your own.
Armin

Jun 27 '08 #2
Thanks Armin,
I searched and searched for an answer but cannot find one. It appears that
if you use Excel 2003 and you have an automated process ,like we do, that if
Excel has a conflist with a file (like Sheet Name), then it will stop the
program. I tried all teh different ways of opening the file, and it will not
get past the eror. The funny thing is, the shet name is "sheet1", which is
the default for Microsoft Excel. it works in 2000, not in 2003. I have not
tried it in 2007.

I'll continue to look, but I think for an immediate fix, we will uninstall
Excel 2003, adn re-install Excell 2000.

Lyners

"Armin Zingler" wrote:
"Lyners" <Ly****@discussions.microsoft.comschrieb
Renamed invalid sheet name.


Have not much experience in this area but searching for "Renamed in
valid sheet name" finds some links, however not all helpful.

This might give an explanation:
http://groups.google.com/group/micro...ac8b1cf62d9ccd

Try this

xlbook = xlApp.Workbooks.Open(OpenFileName, corruptload := <value>)

I think adding CorruptLoad will crash in Excel 2000 and earlier. So, I'd
try it without CorrupLoad, first. If it fails, add it. If it fails again
there is another problem.

Here you find what <valuecan be:
http://msdn.microsoft.com/en-us/libr...ffice.10).aspx
As you don't have a COM automation reference to Excel, you'd probably
have to add the constants (xlNormalLoad, xlRepairFile and xlExtractData)
on your own.
Armin

Jun 27 '08 #3
Hi,

You could try to use some third party component for working with Excel
file. I can recommend you our GemBox.Spreadsheet .NET component for
reading/writing XLS, XLSX, CSV and HTML files (http://
www.gemboxsoftware.com/GBSpreadsheet.htm).

Here is the list of reasons why it is better to use
GemBox.Spreadsheet: http://www.gemboxsoftware.com/GBSpre...htm#Automation

You can use GemBox.Spreadsheet free version (http://
www.gemboxsoftware.com/GBSpreadsheetFree.htm) even in your commercial
applications. Free version has 150 rows limit.

--
Mario
GemBox.Spreadsheet for .NET - Easily read and write Excel (XLS, XLSX
or CSV) files
or export to HTML files from your .NET apps. See
http://www.gemboxsoftware.com/GBSpreadsheet.htm
On May 9, 8:44 pm, Lyners <Lyn...@discussions.microsoft.comwrote:
Thanks Armin,
I searched and searched for an answer but cannot find one. It appears that
if you use Excel 2003 and you have an automated process ,like we do, that if
Excel has a conflist with a file (like Sheet Name), then it will stop the
program. I tried all teh different ways of opening the file, and it will not
get past the eror. The funny thing is, the shet name is "sheet1", which is
the default for Microsoft Excel. it works in 2000, not in 2003. I have not
tried it in 2007.

I'll continue to look, but I think for an immediate fix, we will uninstall
Excel 2003, adn re-install Excell 2000.

Lyners

"Armin Zingler" wrote:
"Lyners" <Lyn...@discussions.microsoft.comschrieb
Renamed invalid sheet name.
Have not much experience in this area but searching for "Renamed in
valid sheet name" finds some links, however not all helpful.
This might give an explanation:
http://groups.google.com/group/micro...rashesgpfs/bro...
Try this
xlbook = xlApp.Workbooks.Open(OpenFileName, corruptload := <value>)
I think adding CorruptLoad will crash in Excel 2000 and earlier. So, I'd
try it without CorrupLoad, first. If it fails, add it. If it fails again
there is another problem.
Here you find what <valuecan be:
http://msdn.microsoft.com/en-us/libr...ffice.10).aspx
As you don't have a COM automation reference to Excel, you'd probably
have to add the constants (xlNormalLoad, xlRepairFile and xlExtractData)
on your own.
Armin
Jun 27 '08 #4
The solution was to uninstall Excel 2003, and install Excel 2000. In Excel
2000 we did not receivei the invalid worksheet name error, thus our program
works now.

Thanks for the help.

"Lyners" wrote:
Thanks Armin,
I searched and searched for an answer but cannot find one. It appears that
if you use Excel 2003 and you have an automated process ,like we do, that if
Excel has a conflist with a file (like Sheet Name), then it will stop the
program. I tried all teh different ways of opening the file, and it will not
get past the eror. The funny thing is, the shet name is "sheet1", which is
the default for Microsoft Excel. it works in 2000, not in 2003. I have not
tried it in 2007.

I'll continue to look, but I think for an immediate fix, we will uninstall
Excel 2003, adn re-install Excell 2000.

Lyners

"Armin Zingler" wrote:
"Lyners" <Ly****@discussions.microsoft.comschrieb
Renamed invalid sheet name.

Have not much experience in this area but searching for "Renamed in
valid sheet name" finds some links, however not all helpful.

This might give an explanation:
http://groups.google.com/group/micro...ac8b1cf62d9ccd

Try this

xlbook = xlApp.Workbooks.Open(OpenFileName, corruptload := <value>)

I think adding CorruptLoad will crash in Excel 2000 and earlier. So, I'd
try it without CorrupLoad, first. If it fails, add it. If it fails again
there is another problem.

Here you find what <valuecan be:
http://msdn.microsoft.com/en-us/libr...ffice.10).aspx
As you don't have a COM automation reference to Excel, you'd probably
have to add the constants (xlNormalLoad, xlRepairFile and xlExtractData)
on your own.
Armin
Jun 27 '08 #5

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

Similar topics

14
by: pmud | last post by:
Hi, I need to use an Excel Sheet in ASP.NET application so that the users can enter (copy, paste ) large number of rows in this Excel Sheet. Also, Whatever the USER ENETRS needs to go to the...
15
by: David | last post by:
Hi, I have built a web application that will be a very high profile application. We had tested it, demonstrated it and shown that it all works. On a dress rehearsal run through, it failed...
3
by: | last post by:
I wrote a class in VB.NET to export the contents of a datagrid to Excel. It works perfectly on my machine, but it fails on my customers' PCs that have identical versions of Win XP (SP1) and Excel...
18
by: Frank M. Walter | last post by:
Hello, I have made an small AddIn with udf for excel 2003. I use vs2003. The point of view is the function __T() I call it in excel sheet writing =__T() I am not able to set a value to a...
1
vinci
by: vinci | last post by:
Please help me out... i only have two weeks to do it... here is my code: Dim ex As New Object Dim wb As Excel.Workbook Dim sheet As Excel.Worksheet
12
by: forrestgump | last post by:
I am currently trying to create VBA to send a specified excel sheet to varied email sources. I currently have the code below which sends the attachment in an email to a specified source e.g....
0
by: Taxman | last post by:
Windows XP, MS Office Excel 2003 If the tasks, I’m trying accomplish have been addressed previously (separately or in combination). Please, provide the links or keyword search to find them. I’ve...
7
by: TG | last post by:
hi! I am trying to create a sql server table from an excel sheet. Here is the code I have: 'This procedure the xlsx file and dumps it to a table in SQL Server
2
hemantbasva
by: hemantbasva | last post by:
Note We need to have a template on server for generating report in multiple sheet as we do not had msoffice on server moreover this require a batch job to delete excel file created by the...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.