今天做一脚本用来解析excel如下:
require "rubygems"
require 'parseexcel'
xsl_root = /opt/tool/guest.xsl
workbook = Spreadsheet::ParseExcel.parse xsl_root
worksheet = workbook.worksheet(0)
...
当我运行时出现异常:
default formats are encoded in ISO-8859-1
OLE::UnknownFormatError: OLE::UnknownFormatError
于是到网上google了一下,说是什么excel保存的格式不对,要成2003的那种,试了一下:
文件=>另存为=>*.xsl
再运行脚本同样的问题!
这个情况怎么处理呢?有遇到过相似问题的吗?
0人喜欢
If you are on Windows platform, it is recommended to use win32ole
The relevant code can be found here http://lj6684.iteye.com/blog/1415623
You can consider using roo