Skip to content

Instantly share code, notes, and snippets.

@changmason
Created August 26, 2011 15:47
Show Gist options
  • Save changmason/1173715 to your computer and use it in GitHub Desktop.
Save changmason/1173715 to your computer and use it in GitHub Desktop.
plot grids in Excel to make wireframes
require 'win32ole'
xls = WIN32OLE.new("Excel.Application")
xls.visible = true
wb = xls.workbooks.add()
ws = wb.worksheets(1)
(1..16).each do |i|
col = i * 3 -1
ws.columns(col).cells(1).value = i
ws.columns(col).borders.lineStyle = 2
ws.columns(col).horizontalAlignment = 3
ws.columns(col).interior.colorIndex = 19
ws.columns(col).columnWidth = 4.38 # 40 px
ws.columns(col-1).columnWidth = 0.77 # 10 px
ws.columns(col+1).columnWidth = 0.77 # 10 px
end
dir = File.expand_path('.')
wb.saveAs(File.join(dir, "16_grids.xls"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment