引用你的代码(加了一句代码调试语句可查看路径)
#include <Excel.au3>
MsgBox(0,"路径",@TempDir & "\Temp.xls")
Local $oExcel = _ExcelBookNew()
_ExcelWriteCell($oExcel, "123", 1, 1)
MsgBox(4096, "Exiting", "Press OK to Save File and Exit")
_ExcelBookSaveAs($oExcel, @TempDir & "\Temp.xls", "xls", 0, 1)
_ExcelBookClose($oExcel)
我在Win7+Office2013的环境下测试完全没问题! 我猜是不是你对这个临时文件夹路径不熟,找不到这个表格,所以~~~ 建议按我的方法到临时文件夹查看,或者修改路径为:@ScriptDir & "\Temp.xls", "xls",代码是这样的:(最后一句关闭表格被注释)
#include <Excel.au3>
MsgBox(0,"路径",@ScriptDir & "\Temp.xls")
Local $oExcel = _ExcelBookNew()
_ExcelWriteCell($oExcel, "123", 1, 1)
MsgBox(4096, "Exiting", "Press OK to Save File and Exit")
_ExcelBookSaveAs($oExcel,@ScriptDir & "\Temp.xls", "xls", 0, 1)
;~ _ExcelBookClose($oExcel)
|