我想寫一些數據從TCL到CSV文件,但我得到0x800a03ec {SaveAs方法的工作簿類失敗}執行時。任何想法爲什麼發生這種情況?0x800a03ec {SaveAs方法的工作簿類失敗}錯誤在TCOM/TCL
set application [::tcom::ref createobject "Excel.Application"]
$application Visible 1
set workbooks [$application Workbooks]
set workbook [$workbooks Add]
set worksheets [$workbook Worksheets]
set worksheet [$worksheets Item [expr 1]]
#set worksheet [$worksheets Item "Sheet1"]
set cells [$worksheet Cells]
set rows [array size atten]
for {set row 1} {$row <= $rows} {incr row} {
$cells Item $row "B" $atten($row)
}
$workbook SaveAs Filename {c:\tst.csv}
$application Quit
我試圖保存到不同的文件夾,也改變<=爲<但仍然收到相同的錯誤 – amateur 2012-03-07 21:48:10
您是否改變了SaveAs行,正如我所說的?我能夠重現你的錯誤,並改變這條線修復它。 – TrojanName 2012-03-08 09:11:17