まずは、Excelファイルを開く方法
require 'win32ole' def fullpath fn fo = WIN32OLE.new('Scripting.FileSystemObject') fo.GetAbsolutePathName(fn) end fn = fullpath('test.xls') xls = WIN32OLE.new('Excel.Application') xls.visible = true book = xls.Workbooks.Open(fn)
GetAbsolutePathName は絶対パス
xls.visible = true にしておくと、Excelのウィンドウが表示される。falseにすると非表示。
![](http://thumbnail.image.rakuten.co.jp/@0_mall/surugaya-a-too/cabinet/4576/bo483945m.jpg?_ex=500x500)
【中古】単行本(実用) ≪コンピュータ≫ Rubyist Magazine出張版 Ruby on Windows / cuzic 【中古】afb