However, LibreOffice does not complain about the file, so it's probably
MS Excel specific.
Try renaming the file and let us know !
Cheers,
Eric
Le 7/02/12 10:01, abi navigator a �crit :
Hi,
I think you should not give the xlsM extension, because the file will
contain no VBA code.
openpyxl is used to build xlsX files only ;-)
However, LibreOffice does not complain about the file, so it's probably
MS Excel specific.
Try renaming the file and let us know !
Cheers,
Eric
Le 7/02/12 10:01, abi navigator a écrit :
--------------------------------------------------------------------------- BadZipfile Traceback (most recent call last) <ipython-input-132-8142f5d8ab79> in <module>() ----> 1 update_xlsx("Jul_2013_Q2.csv", "Jul_2013_Q2.xlsm") <ipython-input-131-311af13ce2a6> in update_xlsx(src, dest) 30 ws.cell(row=index,column=4).value = row[4] 31 #save the csb file ---> 32 wb.save(dest) /Library/Python/2.7/site-packages/openpyxl/workbook.pyc in save(self, filename) 230 save_dump(self, filename) 231 else: --> 232 save_workbook(self, filename) /Library/Python/2.7/site-packages/openpyxl/writer/excel.pyc in save_workbook(workbook, filename) 157 """ 158 writer = ExcelWriter(workbook) --> 159 writer.save(filename) 160 return True 161 /Library/Python/2.7/site-packages/openpyxl/writer/excel.pyc in save(self, filename) 140 """Write data into the archive.""" 141 archive = ZipFile(filename, 'w', ZIP_DEFLATED) --> 142 self.write_data(archive) 143 archive.close() 144 /Library/Python/2.7/site-packages/openpyxl/writer/excel.pyc in write_data(self, archive) 60 shared_string_table = self._write_string_table(archive) 61 ---> 62 archive.writestr(ARC_CONTENT_TYPES, write_content_types(self.workbook)) 63 if not self.workbook.vba_archive: 64 archive.writestr(ARC_ROOT_RELS, write_root_rels(self.workbook)) /Library/Python/2.7/site-packages/openpyxl/writer/workbook.pyc in write_content_types(workbook) 62 seen = set() 63 if workbook.vba_archive: ---> 64 root = fromstring(workbook.vba_archive.read(ARC_CONTENT_TYPES)) 65 register_namespace('', 'http://schemas.openxmlformats.org/package/2006/content-types') 66 for elem in root.findall('{http://schemas.openxmlformats.org/package/2006/content-types}Override'): /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/zipfile.pyc in read(self, name, pwd) 929 def read(self, name, pwd=None): 930 """Return file bytes (as a string) for name.""" --> 931 return self.open(name, "r", pwd).read() 932 933 def open(self, name, mode="r", pwd=None): /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/zipfile.pyc in open(self, name, mode, pwd) 974 raise BadZipfile, \ 975 'File name in directory "%s" and header "%s" differ.' % ( --> 976 zinfo.orig_filename, fname) 977 978 # check for encrypted flag & handle password
BadZipfile: File name in directory "[Content_Types].xml" and header "xl/sharedStrings.xml" differ.
Am .12.2013, 00:04 Uhr, schrieb John Bovey <J.D....@kent.ac.uk>:I agree that the vba / form-controls stuff needs to be better
integrated. Initially I added vba support because I needed
it myself and I wanted to be sure that nothing would break if keep_vba
was false.
That's how we all get involved, I think. After that it's a slippery slope
and before you know it you're implementing the maths engine!
It's all much appreciated. I just think that it's even more important as
the project grows to have test cases *especially* for apparently small
changes.
Charlie