It seems like there is no gems yet to fulfil the task like that, neither
spreadsheet nor roo nor rubyXL(pretends to do that, but doesn’t work for
the moment) support it.
A solution I found on the Net is:
require ‘zip/zipfilesystem’
require ‘nokogiri’
file = “/path/to/test.xlsm”
zip = Zip::ZipFile.open(file)
workbook = Nokogiri::XML(zip.read(‘xl/workbook.xml’))
It seems like it is just an archive… But how to read cells and rows
values?
The documentation is too short
It seems like there is no gems yet to fulfil the task like that, neither
spreadsheet nor roo nor rubyXL(pretends to do that, but doesn’t work for
the moment) support it.
A solution I found on the Net is:
require ‘zip/zipfilesystem’
require ‘nokogiri’
file = “/path/to/test.xlsm”
zip = Zip::ZipFile.open(file)
workbook = Nokogiri::XML(zip.read(‘xl/workbook.xml’))
It seems like it is just an archive… But how to read cells and rows
values?
The documentation is too short
Thank you for your ideas.
XLSM files are Excel “macro-enabled” workbooks, and are indeed
compressed archive files.
On a Windows machine with Excel installed, you could use WIN32OLE to
open, read, and manipulate the workbook…
Thanks a lot, David!
I couldn’t even imagine(frankly speaking, I skipped that chapter
completely when reading a Ruby book) that we could process Excel files
with that Ruby std tool.
thank you so much.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.