yuhuihu / excellibrary

Automatically exported from code.google.com/p/excellibrary
0 stars 0 forks source link

Problems opening generated files with Office 2007 in Windows7/Windows Server 2008 R2 #54

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Create xls file with Excel Library
2. Sample Code:
          Workbook book =  new Workbook();
          Worksheet worksheet = new Worksheet("test");
          book.Worksheets.Add(worksheet);
          book.Save("text.xls");
3.Save the File
4 Open the File with Excel 2007 on a Windows 7/ Windows Server 2008 R2
5.File corruption warning appears (see screenshot)

What is the expected output? What do you see instead?

File should have opened correctly

What version of the product are you using? On what operating system?

Latest binary versio. windows 7 x64, Microsoft Office 2007

Please provide any additional information below.

When opening files generated by excel library (can be generated on any os) 
in Windows 7 or Windows Server 2008 R2 we get a corrupted file warning (see 
screenshots).
Repairing helps, all data is ok. Problem appears to be Windows7/Windows 
Server 2008 R2 Specific. No issues with same file on Vista nor Windows XP
Provided XML log doesn't say much
There are similar threads on other excel libraries, and fixes are provided 
for them, maybe it might help (though it's php): 

http://phpexcel.codeplex.com/Thread/View.aspx?ThreadId=63779 
http://phpexcel.codeplex.com/WorkItem/View.aspx?WorkItemId=10059 (note the 
attached patch)

Original issue reported on code.google.com by gytisgre...@gmail.com on 6 Jan 2010 at 9:11

Attachments:

GoogleCodeExporter commented 9 years ago
I've encountered this save error. Windows 7 64-bit, IIS 7, ASP.NET w/ VB 
codebehind

Original comment by brianweb...@gmail.com on 29 Apr 2010 at 9:59

GoogleCodeExporter commented 9 years ago
I have this same error.  Windows 7 32-bit running office 2007 stnd.  My 
co-worker with Windows XP and office 2007 does not recieve this error message.

Original comment by jxko...@gmail.com on 25 Aug 2010 at 1:17

GoogleCodeExporter commented 9 years ago
I also have this error. win 7 64. However I have found out one more thing.
If the size of the file is over approximately 6000 bytes the error wont show 
up. It doesnt matter if more columns with data are added or more rows. As long 
as the total file size is over those 6000 bytes.

Original comment by j...@plane9.com on 10 Feb 2011 at 2:19

GoogleCodeExporter commented 9 years ago
I encountered the same error, on Windows 7 32-bit running Office 2007 
Enterprise.

As commented by j...@plane9.com, there's no error if file size exceeds about 
6000 bytes. So I found this "solution": when I create my workbook, I fill 200 
cells of the first sheet with null values to reach this size.

   for (var k = 0; k < 200; k++)
       workbook.Worksheets[0].Cells[k, 0] = new Cell(null);

Original comment by g9co...@gmail.com on 25 Mar 2011 at 10:08

GoogleCodeExporter commented 9 years ago
Thanks for the tip gabriele. :)

Original comment by emil.tel...@gmail.com on 18 May 2011 at 8:10

GoogleCodeExporter commented 9 years ago
Thank you again for the tip ;-)

Original comment by michelec...@gmail.com on 7 Sep 2011 at 12:50

GoogleCodeExporter commented 9 years ago
gabriele == genius

Original comment by wblz...@gmail.com on 13 Oct 2011 at 11:48

GoogleCodeExporter commented 9 years ago
Lets sell more harddrives - It worked :-)

Thanks #4

Original comment by lars...@gmail.com on 20 Dec 2011 at 1:54

GoogleCodeExporter commented 9 years ago
Thanks for the useful tip gabriele, it worked!!

Original comment by denisbi...@gmail.com on 6 Feb 2012 at 6:55

GoogleCodeExporter commented 9 years ago
So when is there an update on the excellibrary to solve this?

Original comment by patrick....@gmail.com on 12 Apr 2012 at 6:37

GoogleCodeExporter commented 9 years ago
Adding some content to the file in order to get the file size above 6KB also 
worked for me.

Original comment by Emmanuel...@gmail.com on 12 Jun 2014 at 7:23