命令 $cells Item 2 A {SomeText} 不会设置单元格 A2 中的文本,而是分配单元格 A1 中的文本。知道为什么它会这样吗???
set application [::tcom::ref createobject "Excel.Application"]
set XlFileFormat(xlCSV) [expr 6]
set workbooks [$application Workbooks]
set workbook [$workbooks Add]
$application DisplayAlerts False
set worksheets [$workbook Worksheets]
set worksheet [$worksheets Item [expr 1]]
set cells [$worksheet Cells]
$cells Item 2 A {Range}
$workbook SaveAs {c:\test.csv} $XlFileFormat(xlCSV)
$application Quit