Avatar of APD Toronto
APD Toronto
Flag for Canada asked on

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
Windows 7Windows XPMicrosoft Legacy OSMicrosoft Excel

Avatar of undefined
Last Comment
BillDL

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Darrell Porter

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
APD Toronto

ASKER
Under Control Panel I clicked programs and features, but from that point on there is no Default Programs
APD Toronto

ASKER
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
APD Toronto

ASKER
For some reason EE truncated the extension, but it is .xlsx
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
SOLUTION
David Johnson, CD

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
rindi

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
APD Toronto

ASKER
I thought this is an issue with Windows 7 because I can open in other OSs.
rindi

No. The other OS's probably have m$ Office installed.
APD Toronto

ASKER
m$ Office?

But I tried Office 2010 and 2007 both on Windows 7, same error
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
rindi

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.
SOLUTION
BillDL

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
APD Toronto

ASKER
I am using PHPEXcel to generate this file, if that helps.
APD Toronto

ASKER
Any advice?
Your help has saved me hundreds of hours of internet surfing.
fblack61
BillDL

Unfortunately PHP scripting is not one of my strengths, but there may be other experts lurking around who are expert in this field.
David Johnson, CD

are you using the latest version from github?
APD Toronto

ASKER
I'm using v 1.8.0
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
APD Toronto

ASKER
I downloaded PHPExcel 1.9 from github, the issue persists.
Darrell Porter

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

Darrell Porter

What does your PHP code look like that generates the XLSX file?
Please submit it as a code block.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
APD Toronto

ASKER
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
BillDL

Thank you APD_Toronto