rubyXL icon indicating copy to clipboard operation
rubyXL copied to clipboard

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

Open jdraths opened this issue 8 years ago • 5 comments

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?

jdraths avatar Mar 02 '17 22:03 jdraths

Can you please attach your my-file.xlsm so I can look at it?

weshatheleopard avatar Mar 02 '17 22:03 weshatheleopard

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

jdraths avatar Mar 02 '17 23:03 jdraths

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.

weshatheleopard avatar Mar 02 '17 23:03 weshatheleopard

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

jdraths avatar Mar 02 '17 23:03 jdraths

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).

FE1_TEMPLATE_.xlsm.zip

After adding some rows to the template and saving it with rubyXL, the output (attached) cannot be opened on Excel...

Output.xlsm.zip

knightq avatar Mar 27 '17 09:03 knightq