Created
March 13, 2013 19:47
-
-
Save willblatt/5155462 to your computer and use it in GitHub Desktop.
Quick example for twapi to get values from excel.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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