まずは、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にすると非表示。
【中古】単行本(実用) ≪コンピュータ≫ Rubyist Magazine出張版 Ruby on Windows / cuzic 【中古】afb