Opening .xlsx files in Windows 7

Hi Experts,

I have a software that generates .xlsx file, but I keep getting "Unreadable content in file.xlsx" and the chart is deleted. If I open the same file on a MAC, no error and the chart is there. I am also reading online that these files can be opened in XP, Vista, and even Windows 8. I cannot confirm that.

I also read that this is a security bug in Windows 7.

Does anyone know how to fix this?

I cannot open the file on another OS, re-save it, then re-opened in Windows 7 because there are a lot of files in a fast pace environment.

Any help will be greatly appreciated
APD TorontoSoftware DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Darrell PorterEnterprise Business Process ArchitectCommented:
Open Control Panel and select Programs, then select Default Programs.
Select Associate a file type or protocol with a program.
Select the .xlsx extension and double-click it or select Change Program in the upper right.
If necessary, browse to the directory where Excel is installed and select the appropriate EXCEL.EXE application file.
Select OK then select OK again.  Close the Default Programs and Control Panel windows.
Try opening the XLSX file again.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
APD TorontoSoftware DeveloperAuthor Commented:
Under Control Panel I clicked programs and features, but from that point on there is no Default Programs
0
APD TorontoSoftware DeveloperAuthor Commented:
I found Default programs and did as you described, but the issue persists.

This is the file that I am trying to open. You will notice the chart on a MAC and probably other Windows OS, but not on Windows 7.
NiagaraPAXreport-5cq0jeijug00o8r18e1jdol
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

APD TorontoSoftware DeveloperAuthor Commented:
For some reason EE truncated the extension, but it is .xlsx
0
David Johnson, CD, MVPOwnerCommented:
EE has a bug and only saves the first 40 characters
Excel 2016 error report
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><logFileName>error032400_01.xml</logFileName><summary>Errors were detected in file 'I:\Downloads\NiagaraPAXreport-5cq0jeijug00o8r18e1jdol.xlsx'</summary><removedParts><removedPart>Removed Part: /xl/drawings/drawing1.xml part.  (Drawing shape)</removedPart></removedParts></recoveryLog>

Open in new window

Error msgError message
0
rindiCommented:
You first need a software that can open excel files. As not everyone has excel installed, I suggest you look at libreoffice. It is better than m$ office, OpenSource and free. You can open the file with it:

http://portableapps.com/
http://portableapps.com/apps/office/libreoffice_portable
0
APD TorontoSoftware DeveloperAuthor Commented:
I thought this is an issue with Windows 7 because I can open in other OSs.
0
rindiCommented:
No. The other OS's probably have m$ Office installed.
0
APD TorontoSoftware DeveloperAuthor Commented:
m$ Office?

But I tried Office 2010 and 2007 both on Windows 7, same error
0
rindiCommented:
Maybe it was created with another Office software, for example LibreOffice like I suggested that you use. Those programs can also save their files in using the m$ Office extensions. I opened the file using LibreOffice on my Windows 7 PC, and could read it without problems.
0
BillDLCommented:
>>> "I have a software that generates .xlsx file" <<<

What is this software?
Do you have any control over how it works?
Does the software run on a Mac, Linux, Windows, or some other operating system?

I think that's where the problem lies, and where you will have to look to fix the issue.

You may or may not already know that an *.XLSX file is just a *.ZIP file containing a lot of separate resource files that are all cross-linked with each other.  Most of these files in an XLSX file will be *.XML files, or in XML layout.

Prior to Microsoft Office Excel 2007, spreadsheet files were saved with the *.XLS extension.  These files are mostly binary data all in one package.  Excel 2007 introduced XLSX, XLSM (spreadsheet containing Macros), and several other variations.  Those files are ZIP containers that are more or less "unpacked" when run by an application that supports the file type, and all the cross-referenced resource files are parsed.

Here are all the resource files inside your attached XLSX file:
NiagaraPAXreport.xlsx
|
|   [Content_Types].xml
|   
+---docProps
|       app.xml
|       core.xml
|       
+---xl
|   |   sharedStrings.xml
|   |   styles.xml
|   |   workbook.xml
|   |   
|   +---charts
|   |       chart1.xml
|   |       
|   +---drawings
|   |   |   drawing1.xml
|   |   |   
|   |   \---_rels
|   |           drawing1.xml.rels
|   |           
|   +---theme
|   |       theme1.xml
|   |       
|   +---worksheets
|   |   |   sheet1.xml
|   |   |   
|   |   \---_rels
|   |           sheet1.xml.rels
|   |           
|   \---_rels
|           workbook.xml.rels
|           
\---_rels
        .rels

Open in new window

David Johnson posted details of the error messages that he encountered while trying to open your file in Excel 2016:

Removed Part: /xl/drawings/drawing1.xml part.  (Drawing shape)

"drawing1.xml" contains:
<c:chart xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" r:id="rId1"/>

The file "drawing1.xml.rels" in the _rels sub-folder establishes the relationship of the embedded chart with the file which contains all the chart layout settings and cell references:

<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart" Target="../charts/chart1.xml"/>

"chart1.xml" contains all the chart formatting layout (gridlines, fonts, orientation, etc) and also the cell references it needs to populate the chart, for example:
<c:f>'Daily Passenger Totals'!$B$5:$B$13</c:f>

I notice that row 13 of your spreadsheet data is blank, but I don't think that references to unpopulated cells would really cause any issues.

Somewhere between drawing1.xml > drawing1.xml.rels > chart1.xml, Microsoft Excel on Windows is finding something that it doesn't like or cannot resolve, but on your Mac the application that opens it can do so without error.  It is as though Excel is unable to follow the cross-links to load the chart.

My version of LibreOffice Calc opens this XLSX file without error to display the cellular data and chart, but I am not sure whether the chart is complete because the columns in the bar graph aren't properly labelled.  Even if I do a "Save As" and resave the file to the older Office 97 to 2003 *.XLS, or the 2007 onwards *.XLSX format, the file still errors out on Excel.  I don't have a Mac, so I can't test this.

I think you will have to go back to the program that creates these XLSX files and see whether there are any settings (eg. compatibility settings) that you can experiment with to see whether it will create a spreadsheet that opens in all the applications and operating systems that you need to view the files on.
0
APD TorontoSoftware DeveloperAuthor Commented:
I am using PHPEXcel to generate this file, if that helps.
0
APD TorontoSoftware DeveloperAuthor Commented:
Any advice?
0
BillDLCommented:
Unfortunately PHP scripting is not one of my strengths, but there may be other experts lurking around who are expert in this field.
0
David Johnson, CD, MVPOwnerCommented:
are you using the latest version from github?
0
APD TorontoSoftware DeveloperAuthor Commented:
I'm using v 1.8.0
0
APD TorontoSoftware DeveloperAuthor Commented:
I downloaded PHPExcel 1.9 from github, the issue persists.
0
Darrell PorterEnterprise Business Process ArchitectCommented:
One issue with this file is the drawing object, xl\drawings\drawing1.xml, which seems to be malformed.
Is there some functionality you need in Excel 2007/2010/2013 you cannot find in 2003 or prior?

To rephrase, do you need XLSX format, or can you recode your solution to create either a CSV or XLS file?

If you don't need the drawing object, can you omit it?

Have you opened the XLSX file with 7Zip or Winzip to look at the contents in detail to ensure your code is generating the XML as expected?

This is the contents of the drawing1.xls from the file you attached previously:

<?xml version="1.0" encoding="UTF-8" standalone="true"?>
-<xdr:wsDr xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:xdr="http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing">
	-<xdr:twoCellAnchor>
		-<xdr:from>
			<xdr:col>0</xdr:col>
			<xdr:colOff>0</xdr:colOff>
			<xdr:row>16</xdr:row>
			<xdr:rowOff>0</xdr:rowOff>
		</xdr:from>
		-<xdr:to>
			<xdr:col>12</xdr:col>
			<xdr:colOff>95250</xdr:colOff>
			<xdr:row>40</xdr:row>
			<xdr:rowOff>95250</xdr:rowOff>
		</xdr:to>
		-<xdr:graphicFrame macro="">
			-<xdr:nvGraphicFramePr>
				<xdr:cNvPr id="1025" name="Chart 1"/>
				-<xdr:cNvGraphicFramePr>
					<a:graphicFrameLocks/>
				</xdr:cNvGraphicFramePr>
			</xdr:nvGraphicFramePr>
			-<xdr:xfrm>
				<a:off y="0" x="0"/>
				<a:ext cy="0" cx="0"/>
			</xdr:xfrm>
			-<a:graphic>
				-<a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/chart">
					<c:chart r:id="rId1"
						xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
						xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart"/>
				</a:graphicData>
			</a:graphic>
		</xdr:graphicFrame>
		<xdr:clientData/>
	</xdr:twoCellAnchor>
</xdr:wsDr>

Open in new window

0
Darrell PorterEnterprise Business Process ArchitectCommented:
What does your PHP code look like that generates the XLSX file?
Please submit it as a code block.
0
APD TorontoSoftware DeveloperAuthor Commented:
Its strange. When I run from PHPExcel exmples/33chrtcreate-bar.php, there is no error, but when I adjust this code to my needs in chart.php, I get the error. I don't understand. I am attaching both files.
33chartcreate-bar.php
chart.php
0
BillDLCommented:
Thank you APD_Toronto
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows 7

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.