Skip to content

Instantly share code, notes, and snippets.

@willblatt
Created March 13, 2013 19:47
Show Gist options
  • Save willblatt/5155462 to your computer and use it in GitHub Desktop.
Save willblatt/5155462 to your computer and use it in GitHub Desktop.
Quick example for twapi to get values from excel.
puts [package names]
package require twapi
set excel [::twapi::comobj Excel.Application]
$excel DisplayAlerts [expr 0]
set workbooks [$excel Workbooks]
$workbooks Open "C:/Users/willblatt/BlattBros/Projects/10000 Temp/XLS_Files_Chip/CHIP_ASSAY_TABLE.xlsx"
set workbook [$workbooks Item 1]
set sheets [$workbook Sheets]
set sheet [$sheets Item 1]
set cells [$sheet range a1 c3]
puts [$cells Value]
$cells -destroy
$sheet -destroy
$sheets -destroy
$workbook -destroy
$workbooks -destroy
$excel Quit
$excel -destroy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment