each

WIN32OLE#each {|i|...}
Instance Public methods

Iterates over each item of OLE collection which has IEnumVARIANT interface.

excel = WIN32OLE.new('Excel.Application')
book = excel.workbooks.add
sheets = book.worksheets(1)
cells = sheets.cells("A1:A5")
cells.each do |cell|
  cell.value = 10
end
doc_ruby_on_rails
2015-06-12 20:55:55
Comments
Leave a Comment

Please login to continue.