renebigot / XlsxReaderWriter

XlsxReaderWriter is an Objective-C library for iPhone / iPad and Mac. It parses and writes MS Excel XLSX files.
MIT License
437 stars 119 forks source link

Excel File Open Error #95

Open hengchengfei opened 6 years ago

hengchengfei commented 6 years ago

Saved the excel successfully, When add the follow codes,the generated excel file can't opened. if not edit the cell,it's OK.

worksheet.cell(forCellReference: "A1", shouldCreate: true).setStringValue("xxxx")
screen shot 2018-02-28 at 8 04 49 pm
SNanjappa commented 6 years ago

Any luck with this?? I am able to read contents of cell from worksheet but i am not able to write it to a xlsx file :( I am stuck here. Help needed

charlymr commented 6 years ago

@SNanjappa I actually got it to work in my Fork. It's in Beta, but I would like to have user testing it. https://github.com/charlymr/XlsxReaderWriter/tree/2.4.0.Beta.3

vinceplusplus commented 6 years ago

@charlymr i followed your instructions, it didn't work. it always spilt out the following error message

[!] Unable to find a specification for `SSZipArchive (~> 2.1)` depended upon by `XlsxReaderWriter`

however, if i add the following to my Podfile then it works

pod 'SSZipArchive', '~> 2.1'

thanks for @renebigot's and your great work

charlymr commented 6 years ago

@vinceplusplus I think this is because my pod specs are looking for SSZipArchive in the wrong cocoapods specs repo.

I'll double check that, but yes adding SSZipArchive like you did should sort the issue. Thanks for pointing it out.

I will eventually rename the repo and push it to the Master Cocoapods Specs so that discovery is easier.

kuglemic commented 6 years ago

Thanks for your Fork @charlymr

I tried 2.4.0.Beta.3 but the problem still exists for me.

Can you give me some hints what you think the problem is / which part of the code might be the problem / how we can debug it.

Then I would also have a look at the code and maybe can contribute a fix.

Interesting: Numbers, Dropbox Preview can open the Xlsx File without problems.

EricVoll commented 5 years ago

I do have the same issue at the moment. I will try the mentioned fork and deliver feedback on that...

EricVoll commented 5 years ago

There is a beta release that fixes this problem. (At least for a couple of people) https://github.com/charlymr/XlsxReaderWriter/tree/2.4.0.Beta.4

Captgrom commented 5 years ago

I found that this error occurs due to wrong position of XR tag in the xl/workbook.xml file. It is moved from original position. Simply move it to the previous position and the problem disappear.

jzafar commented 5 years ago

@Captgrom i am also facing same issue. my xlsx file is not opening. how can i move xr to previous position?

Captgrom commented 5 years ago

@Captgrom i am also facing same issue. my xlsx file is not opening. how can i move xr to previous position?

No idea. I edit my xlsx files manually now.

jzafar commented 5 years ago

@charlymr Have you fixed xlxs open file issue. i can't find your 2.4 beta wheree you have fixed this issue.

EricVoll commented 5 years ago

@jzafar For some reason the hyperlink does not work as expected. Try copying the link into the browser. The branch still exists.

EricVoll commented 5 years ago

This is a link to the corresponding issue on the other fork https://github.com/charlymr/XlsxReaderWriter/issues/7

cristogomez commented 4 years ago

If you want to fix the "XlsxReaderWriter" Library, add << @"xr:revisionPtr" >> tag in "NSDictionary+OpenXmlString.m" File. You must to add in "openXmlOrderedKeys" NSDictionary. Like this:

@"workbook": @[ @"xmlns", @"xmlns:r", @"fileVersion", @"fileSharing", @"workbookPr", @"workbookProtection", @"mc:AlternateContent", @"xr:revisionPtr", @"bookViews", @"sheets", @"functionGroups", @"externalReferences", @"definedNames", @"calcPr", @"oleSize", @"customWorkbookViews", @"pivotCaches", @"smartTagPr", @"smartTagTypes", @"webPublishing", @"fileRecoveryPr", @"webPublishObjects", @"extLst" ],