Blank Output file after Warning Message: *** WARNING: storage class not found for ../activeX/activeX1.xml (http://schemas.openxmlformats.org/officeDocument/2006/relationships/control) WARNING: RubyXL::Worksheet is not aware what to do with RubyXL::GenericStorageObject
Attempting to parse and write to an existing XLSM file
require 'rubyXL'
XLSM_PATH = File.join(Rails.root, '/lib/templates/my-file.xlsm')
book = RubyXL::Parser.parse(XLSM_PATH)
sheet = book.worksheets[0]
puts sheet[0][0] # should be STORE
sheet[0][1].change_contents("136", sheet[0][0].formula) # Sets value of cell A1 to empty string, preserves formula
book.write '/Users/MyName/Downloads/my_sheet.xlsm'
The output:
*** WARNING: storage class not found for ../activeX/activeX1.xml (http://schemas.openxmlformats.org/officeDocument/2006/relationships/control)
WARNING: RubyXL::Worksheet is not aware what to do with RubyXL::GenericStorageObject
STORE
=> "/Users/MyName/Downloads/my_sheet.xlsm"
When I open my_sheet.xlsm in Numbers it is fine.
When I open my_sheet.xlsm in Excel I get the following error:
We found a problem with some content in 'my_sheet.xlsm'. Do you want us to try to recover as much as we can?
Is there maybe a problem with the macro that is attached to my existing XLSM file?
Can you please attach your my-file.xlsm so I can look at it?
That last one had a password on the VBA code.
Github won't let me share an .xlsm file. So I tried renaming the extension to .xlsx, though that might get rid of the macro that's causing the problem in the first place. my-file-no-pw.xlsx
I submitted the code that might fix the problem. Can you check and see if it works for you? If yes, I will release the new version of the gem.
That commit still outputs a blank file in excel, but the warning from RubyXL is different:
WARNING: RubyXL::ActiveX is not aware what to do with RubyXL::ActiveXBinary
Same problem: with the attached file I get the following warnings:
WARNING: RubyXL::Worksheet is not aware what to do with RubyXL::GenericStorageObject [27/987] WARNING: RubyXL::Worksheet is not aware what to do with RubyXL::GenericStorageObject WARNING: RubyXL::Worksheet is not aware what to do with RubyXL::GenericStorageObject *** WARNING: storage class not found for ../activeX/activeX15.xml (http://schemas.openxmlformats.org/officeDocument/2006/relationships/control) *** WARNING: storage class not found for ../activeX/activeX14.xml (http://schemas.openxmlformats.org/officeDocument/2006/relationships/control) *** WARNING: storage class not found for ../activeX/activeX13.xml (http://schemas.openxmlformats.org/officeDocument/2006/relationships/control) WARNING: RubyXL::Worksheet is not aware what to do with RubyXL::GenericStorageObject WARNING: RubyXL::Worksheet is not aware what to do with RubyXL::GenericStorageObject WARNING: RubyXL::Worksheet is not aware what to do with RubyXL::GenericStorageObject *** WARNING: storage class not found for ../activeX/activeX30.xml (http://schemas.openxmlformats.org/officeDocument/2006/relationships/control) *** WARNING: storage class not found for ../activeX/activeX29.xml (http://schemas.openxmlformats.org/officeDocument/2006/relationships/control) *** WARNING: storage class not found for ../activeX/activeX28.xml (http://schemas.openxmlformats.org/officeDocument/2006/relationships/control) WARNING: RubyXL::Worksheet is not aware what to do with RubyXL::GenericStorageObject WARNING: RubyXL::Worksheet is not aware what to do with RubyXL::GenericStorageObject WARNING: RubyXL::Worksheet is not aware what to do with RubyXL::GenericStorageObject *** WARNING: storage class not found for ../activeX/activeX12.xml (http://schemas.openxmlformats.org/officeDocument/2006/relationships/control) *** WARNING: storage class not found for ../activeX/activeX11.xml (http://schemas.openxmlformats.org/officeDocument/2006/relationships/control) *** WARNING: storage class not found for ../activeX/activeX10.xml (http://schemas.openxmlformats.org/officeDocument/2006/relationships/control) WARNING: RubyXL::Worksheet is not aware what to do with RubyXL::GenericStorageObject WARNING: RubyXL::Worksheet is not aware what to do with RubyXL::GenericStorageObject WARNING: RubyXL::Worksheet is not aware what to do with RubyXL::GenericStorageObject *** WARNING: storage class not found for ../activeX/activeX27.xml (http://schemas.openxmlformats.org/officeDocument/2006/relationships/control) *** WARNING: storage class not found for ../activeX/activeX26.xml (http://schemas.openxmlformats.org/officeDocument/2006/relationships/control) *** WARNING: storage class not found for ../activeX/activeX25.xml (http://schemas.openxmlformats.org/officeDocument/2006/relationships/control) WARNING: RubyXL::Worksheet is not aware what to do with RubyXL::GenericStorageObject WARNING: RubyXL::Worksheet is not aware what to do with RubyXL::GenericStorageObject WARNING: RubyXL::Worksheet is not aware what to do with RubyXL::GenericStorageObject *** WARNING: storage class not found for ../activeX/activeX9.xml (http://schemas.openxmlformats.org/officeDocument/2006/relationships/control) *** WARNING: storage class not found for ../activeX/activeX8.xml (http://schemas.openxmlformats.org/officeDocument/2006/relationships/control) *** WARNING: storage class not found for ../activeX/activeX7.xml (http://schemas.openxmlformats.org/officeDocument/2006/relationships/control) WARNING: RubyXL::Worksheet is not aware what to do with RubyXL::GenericStorageObject WARNING: RubyXL::Worksheet is not aware what to do with RubyXL::GenericStorageObject WARNING: RubyXL::Worksheet is not aware what to do with RubyXL::GenericStorageObject *** WARNING: storage class not found for ../activeX/activeX24.xml (http://schemas.openxmlformats.org/officeDocument/2006/relationships/control) *** WARNING: storage class not found for ../activeX/activeX23.xml (http://schemas.openxmlformats.org/officeDocument/2006/relationships/control) *** WARNING: storage class not found for ../activeX/activeX22.xml (http://schemas.openxmlformats.org/officeDocument/2006/relationships/control) WARNING: RubyXL::Worksheet is not aware what to do with RubyXL::GenericStorageObject WARNING: RubyXL::Worksheet is not aware what to do with RubyXL::GenericStorageObject WARNING: RubyXL::Worksheet is not aware what to do with RubyXL::GenericStorageObject *** WARNING: storage class not found for ../activeX/activeX6.xml (http://schemas.openxmlformats.org/officeDocument/2006/relationships/control) *** WARNING: storage class not found for ../activeX/activeX5.xml (http://schemas.openxmlformats.org/officeDocument/2006/relationships/control) *** WARNING: storage class not found for ../activeX/activeX4.xml (http://schemas.openxmlformats.org/officeDocument/2006/relationships/control) WARNING: RubyXL::Worksheet is not aware what to do with RubyXL::GenericStorageObject WARNING: RubyXL::Worksheet is not aware what to do with RubyXL::GenericStorageObject WARNING: RubyXL::Worksheet is not aware what to do with RubyXL::GenericStorageObject *** WARNING: storage class not found for ../activeX/activeX21.xml (http://schemas.openxmlformats.org/officeDocument/2006/relationships/control) *** WARNING: storage class not found for ../activeX/activeX20.xml (http://schemas.openxmlformats.org/officeDocument/2006/relationships/control) *** WARNING: storage class not found for ../activeX/activeX19.xml (http://schemas.openxmlformats.org/officeDocument/2006/relationships/control) WARNING: RubyXL::Worksheet is not aware what to do with RubyXL::GenericStorageObject WARNING: RubyXL::Worksheet is not aware what to do with RubyXL::GenericStorageObject WARNING: RubyXL::Worksheet is not aware what to do with RubyXL::GenericStorageObject
and the xlsm does not open in Excel (same error as above).
After adding some rows to the template and saving it with rubyXL, the output (attached) cannot be opened on Excel...