L
Li Chen
Hi all,
I copy a script from WIN32OLE documentation and run it. I find that Ruby
complains it at line cells = sheets.cells("A1:A5").
Do I miss something?
Thanks,
Li
##
require 'win32ole'
excel = WIN32OLE.new('Excel.Application')
excel.Visible="True"
book = excel.workbooks.add
sheets = book.worksheets(1)
cells = sheets.cells("A1:A5")
cells.each do |row|
row.value = 10
end
##output
OLE error code:80020005 in <Unknown>
<No Description>
HRESULT error code:0x80020009
Exception occurred. from test3.rb:13
I copy a script from WIN32OLE documentation and run it. I find that Ruby
complains it at line cells = sheets.cells("A1:A5").
Do I miss something?
Thanks,
Li
##
require 'win32ole'
excel = WIN32OLE.new('Excel.Application')
excel.Visible="True"
book = excel.workbooks.add
sheets = book.worksheets(1)
cells = sheets.cells("A1:A5")
cells.each do |row|
row.value = 10
end
##output
test3.rb:13:in `method_missing': cells (WIN32OLERuntimeError)ruby test3.rb
OLE error code:80020005 in <Unknown>
<No Description>
HRESULT error code:0x80020009
Exception occurred. from test3.rb:13