We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Error opening Excel file

Thread ID:

Created:

Updated:

Platform:

Replies:

50210 Oct 9,2006 11:56 AM Oct 11,2006 06:14 AM Windows Forms 1
loading
Tags: XlsIO
Doug Schwenk
Asked On October 9, 2006 11:56 AM

When I try to open an Excel file with a path like this:

S:\data\2006\10-16-06 data 2.xls

I get an exception below. Are dash or space illegal characters?

--------------------------------------------
ex.ToString() "System.ArgumentException: Illegal characters in path.\r\n at System.IO.Path.CheckInvalidPathChars(String path)\r\n at System.IO.Path.GetFileName(String path)\r\n at Syncfusion.XlsIO.Implementation.ExternWorkbookImpl.InitShortName()\r\n at Syncfusion.XlsIO.Implementation.ExternWorkbookImpl.Parse(BiffReader reader)\r\n at Syncfusion.XlsIO.Implementation.Collections.ExternBookCollection.Parse(BiffReader reader)\r\n at Syncfusion.XlsIO.Implementation.WorkbookImpl.Parse(BiffReader reader, ExcelParseOptions options)\r\n at Syncfusion.XlsIO.Implementation.WorkbookImpl..ctor(IApplication application, Object parent, Stream stream, ExcelParseOptions options)\r\n at Syncfusion.XlsIO.Implementation.ApplicationImpl.CreateWorkbook(Object parent, Stream stream, ExcelParseOptions options)\r\n at Syncfusion.XlsIO.Implementation.Collections.WorkbooksCollection.OpenReadOnly(String strFileName, ExcelParseOptions options)\r\n at Syncfusion.XlsIO.Implementation.Collections.WorkbooksCollection.OpenReadOnly(String strFileName)\r\n at ReadStaticPositions.Form1.ReadPositions() in c:\\projects\\ReadStaticPositions\\ReadStaticPositions\\Form1.cs:line 58" string


-----------------------------------------------
Here''s the C# code:

ExcelEngine excelEngine = new ExcelEngine();
IApplication application = excelEngine.Excel;

string fp = StaticPath();
if( !File.Exists(fp) )
MessageBox.Show("Can''t find file\n\n" + fp);

IWorkbook workbook = application.Workbooks.OpenReadOnly(fp);
IWorksheet sheet = workbook.Worksheets[0];

MessageBox.Show(sheet.Range["A10"].Text);

excelEngine.ThrowNotSavedOnDestroy = false;
excelEngine.Dispose();

Melba Winshia [Syncfusion]
Replied On October 11, 2006 06:14 AM

Hi Doug,

I am afraid. I was unable to reproduce the issue. I used the following test sample to test your issue.

Sample :
Patherror.zip


Would it be possible to provide me your sample xls file in which you are able to reproduce the issue? It will help me in investigating further on this issue.

Thanks,
Melba




CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;