批量选择后,_ExcelBookOpen好像无法打开$arrFileList[$iFileIndex]
求大侠帮忙解决Dim $strFiles = FileOpenDialog("选择一个或多个温度数据文件", @WindowsDir & "", "表格文件(*.xlsx)", 1+4)
If @error Or $strFiles = "" Then
MsgBox(4096, "警告", "选择文件失败!")
Exit
EndIf
;将多个文件路径分割
Dim $arrFileList = StringSplit($strFiles, "|")
Dim $iFileIndex = 1
For $iFileIndex = 1 To $arrFileList[0]
Local $sFilePath1 = $arrFileList[$iFileIndex]
Local $oExcel = _ExcelBookOpen("$sFilePath1")
_ExcelWriteCell($oExcel, "=AVERAGE(LARGE(B6:FE125,51))", 1, 10)
_ExcelBookSaveAs($oExcel, $strFiles, "xlsx", 0, 1)
_ExcelBookClose($oExcel) ; And finally we close out
Next
MsgBox(4096, "提示", "操作完成!")
|