Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 28
Default Excel 2007 crashes on copying worksheet to new workbook

I'm using Outlook2007. I have a .xlsx Excel Workbook without about 15
worksheets in it. One of them contains a table. This worksheet appears to
function properly; I haven't noticed any problems using the 'Total' row to
sum, count etc, and I'm not having problems using the drop-down options in
the header row to sort, filter, etc. But recently, when I try to make a copy
of this worksheet in a new workbook, by right-clicking on the worksheet tab
and selecting 'new book' with 'make a copy' selected, Excel crashes. When
Excel re-starts, is shows me the 'new' workbook in the recovered /open files
pane, but if I click on the 'new' workbook I get an error message 'Excel
found unreadable content in 'Book3 (version1).xlsb. Do you want to recover
the contents of this workbook?' and if I say yes, the next message tells me
it cannot be opened because the file is corrupt.

I've tried starting with a new, blank, workbook and selecting all the data
in the original worksheet by clicking the top-left hand corner and using copy
and paste to put the data in the new worksheet/workbook - that works, but if
I try and then do the right-click on the tab in the new workbook to make a
new copy in another new workbook, that also crashes Excel. I've tried
converting the table back to a normal range but that made no difference. I
saved the workbook in xls format but the same thing happens. It seems
whatever is causing the crash is embedded in the worksheet but how do I track
down and correct it?

  #2   Report Post  
Junior Member
 
Posts: 1
Default

I have experienced this same issue and finally found a solution although I do not know why the solution worked. Ultimately I believe the problem lies in a corrupted XML file in the .xlsx file but I do not know why or how the corruption was created. I believe the corruption is located in styles.xml.

I compared the xml files in the \xl\tables\ folder with the xml files in the \xl\tables\ folder of a .xlsx file that does not exhibit the behaviour you describe.

I then removed a single value/pair (specifically the headerRowCellStyle="Normal 2") from

<<<<<<
<table xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" id="3" name="Table3" displayName="Table3" ref="A6:T21" totalsRowShown="0" headerRowDxfId="65" headerRowBorderDxfId="64" tableBorderDxfId="63" totalsRowBorderDxfId="62" headerRowCellStyle="Normal 2"
<<<<<<

To produce

<<<<<<
<table xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" id="3" name="Table3" displayName="Table3" ref="A6:T21" totalsRowShown="0" headerRowDxfId="65" headerRowBorderDxfId="64" tableBorderDxfId="63" totalsRowBorderDxfId="62"
<<<<<<

then saved the table1.xml file back into the .xlsx file and the workbook now allows me to copy the offending worksheet to a <new book or any other workbook without crashing Excel.

I then created a new .xlsx file and copied the styles.xml file from the clean copy to overwrite the styles.xml file in the problematic file. When I subsequently tried to open the problematic file, Excel detected the corrupt information in the problematic file, removed it and now the workbook worked correctly. NOTE: Removing the "styles.xml" file is a method of last resort (only to be used if you cannot find the specific .xml files that contain bad references) since this action will remove all formatting you have created and used in your file.


If you are not familiar with how to extract the .xml files from a .xlsx file format, the simplest way is to rename the file with a .zip extension (on Windows7) then open the zip file, copy the specific table.xml files to any local directory, edit the .xml files, then copy (overwrite) them back into the .zip (renamed) file and remove the .zip extension from your original .xlsx file. For more info, see Wikipedia on OOXML <http://en.wikipedia.org/wiki/Office_Open_XML

excerpt: "An Office Open XML file is a ZIP-compatible OPC package containing XML documents and other resources. That is, one can see the contents of an OOXML file, for example by renaming it to a .zip file and opening it with any zip tool. The actual .xml files can then be viewed in a web browser or a plain text editor."

Last edited by smeadows : March 17th 12 at 12:48 AM Reason: Further investigation
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 crashes when copying to Word?? L.S. Excel Discussion (Misc queries) 10 August 13th 09 04:01 PM
Excel 2007 - copying filtered data to another workbook texansgal Excel Worksheet Functions 1 June 15th 09 11:05 PM
Excel 2007 Crashes rykkim Excel Discussion (Misc queries) 0 February 19th 09 09:33 PM
Password protected workbook crashes copying worksheet SueD Excel Discussion (Misc queries) 0 April 21st 08 01:21 PM
Excel 2003 converted to 2007 copying worksheet error MAC Excel Discussion (Misc queries) 0 September 6th 07 08:16 PM


All times are GMT +1. The time now is 02:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"