each

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

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

1
2
3
4
5
6
7
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
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.