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.

Can''t open any xlsx files

Thread ID:

Created:

Updated:

Platform:

Replies:

73976 May 27,2008 12:54 PM Aug 7,2008 07:18 AM ASP.NET Web Forms (Classic) 5
loading
Tags: XlsIO
Matt Smith
Asked On May 27, 2008 12:54 PM

I'm using Trial 6.3.0.6 and I can't seem to open any xlsx files. I tried several different xlsx, including opening your sample Invoice.xls and saving it as a xlsx. When I try:
FileStream fs = File.OpenRead("c:\\invoice.xlsx");
IWorkbook wb = app.Workbooks.Open(fs);
I get:
System.Runtime.InteropServices.ExternalException was unhandled
Message="Can't open storage on LockBytes."
Source="Syncfusion.XlsIO.Base"
ErrorCode=-2147286960
StackTrace:
at Syncfusion.XlsIO.IO.Stream.StgStream..ctor(Stream stream, STGM flags)
at Syncfusion.XlsIO.IO.Stream.StgStream..ctor(Stream stream)
at Syncfusion.XlsIO.Implementation.WorkbookImpl.ParseExcel97Stream(Stream stream, ExcelParseOptions options)
at Syncfusion.XlsIO.Implementation.WorkbookImpl..ctor(IApplication application, Object parent, Stream stream, ExcelParseOptions options, ExcelVersion version)
at Syncfusion.XlsIO.Implementation.WorkbookImpl..ctor(IApplication application, Object parent, Stream stream, ExcelVersion version)
at Syncfusion.XlsIO.Implementation.ApplicationImpl.CreateWorkbook(Object parent, Stream stream, ExcelVersion version)
at Syncfusion.XlsIO.Implementation.Collections.WorkbooksCollection.Open(Stream stream)
at Test.TestExcel.Go() in C:\Tests\TestMatt\TestExcel.cs:line 24
at Test.Program.Main(String[] args) in C:\Tests\TestMatt\Program.cs:line 23
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

When I try:
IWorkbook wb = app.Workbooks.Open("c:\\invoice.xlsx");
I get:
System.Runtime.InteropServices.ExternalException was unhandled
Message="Cannot open storage. File Name is: c:\\invoice.xlsx"
Source="Syncfusion.XlsIO.Base"
ErrorCode=-2147286960
StackTrace:
at Syncfusion.XlsIO.IO.Stream.StgStream..ctor(String fileName, STGM flags)
at Syncfusion.XlsIO.Implementation.WorkbookImpl..ctor(IApplication application, Object parent, String strFileName, ExcelParseOptions options, Boolean bReadOnly, String password, ExcelVersion version)
at Syncfusion.XlsIO.Implementation.WorkbookImpl..ctor(IApplication application, Object parent, String strFileName, ExcelParseOptions options, ExcelVersion version)
at Syncfusion.XlsIO.Implementation.WorkbookImpl..ctor(IApplication application, Object parent, String FileName, ExcelVersion version)
at Syncfusion.XlsIO.Implementation.ApplicationImpl.CreateWorkbook(Object parent, String strTemplateFile, ExcelVersion version)
at Syncfusion.XlsIO.Implementation.Collections.WorkbooksCollection.Open(String filename)
at Test.TestExcel.Go() in C:\Tests\TestMatt\TestExcel.cs:line 21
at Test.Program.Main(String[] args) in C:\Tests\TestMatt\Program.cs:line 23
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

Opening xls files works just fine. I'm running XP 32bit with VS 2005. Let me know if you need any more info.


Yavanaarasi G [Syncfusion]
Replied On May 28, 2008 05:38 AM

Hi Matt,

Thank you for your interest in Syncfusion products.

I am able to reproduce the issue that you have mentioned. But this issue can be solved by adding the ExcelOpenType.Automatic property while opening the workbook.

Here is the code snippet:


[C#]
IApplication app = excelEngine.Excel;
FileStream fs = File.OpenRead("C:\\Invoice.xlsx");
IWorkbook wb = app.Workbooks.Open(fs, ExcelOpenType.Automatic);



Please try this and let me know if this helps.

Regards,
G.Yavana



Matt Smith
Replied On May 28, 2008 12:58 PM

That worked, thanks!


Yavanaarasi G [Syncfusion]
Replied On May 29, 2008 06:12 AM

Hi Matt,

Thank you for your update.

Glad to hear that the problem could be solved.

Please let me know if you have any other concerns.

Regards,
G.Yavana


Prakash
Replied On July 29, 2008 05:35 AM

Hi,
I am using the component, syncfusion.XlsIO. I have excel file which having 42 columns and 400 rows of data. While invoking the method, sheets.ExportDataTable() ... it takes more than 4 minutes to load the data into the data table.
Can u pls help me to improve the performance?

Regards
Prakash M

>Hi Matt,

Thank you for your update.

Glad to hear that the problem could be solved.

Please let me know if you have any other concerns.

Regards,
G.Yavana




Yavanaarasi G [Syncfusion]
Replied On August 7, 2008 07:18 AM

Hi Prakash,

Sorry for the delay in responding.

I am not able to reproduce the issue that you mentioned here. I have created a file with 42 columns, 400 rows and Export the DataTable. The time takes less than 1min.

Here is the sample for your reference:
http://www.syncfusion.com/development/uploads/ExportDatatable_96dd9215.zip

We have tested this issue in our latest version of Essential studio 2008 volume 3 [v6.3.0.30]. We have optimized the performance in the latest version. Could you please let me know the Essential studio version in which the issue caused?

Regards,
G.Yavana


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.

;