Skip to content

Instantly share code, notes, and snippets.

@tallakt
Created April 3, 2014 05:41
Show Gist options
  • Save tallakt/9948833 to your computer and use it in GitHub Desktop.
Save tallakt/9948833 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'win32ole'
e=WIN32OLE::connect "Excel.Application"
e.Sheets.Count.times do |n|
sheet = e.Sheets(n + 1)
v = sheet.UsedRange.Value2
puts "=== Sheet: #{sheet.Name}"
v.each do |row|
puts row.map {|x| x || ""}.join "\t"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment