完整代码如下:
Display.SelectFileDialog.SelectFiles Title: $'''选择文件''' FileFilter: $'''.xlsx;.xls;*.xlsm''' IsTopMost: True CheckIfFileExists: False SelectedFiles=> SelectedFiles ButtonPressed=> ButtonPressed
LOOP FOREACH CurrentItem IN SelectedFiles
@@copilotGeneratedAction: 'False'
Scripting.RunVBScript.RunVBScript VBScriptCode: $'''sub prt()
Dim ExlApp
Dim strPath
Set ExlApp = CreateObject(\"Excel.Application\")
on error goto line
strPath = \"%CurrentItem.FullName%\"
WScript.Echo strPath
ExlApp.Visible=True
ExlApp.Workbooks.open(strPath)
ExlApp.ActiveWorkbook.WorkSheets(1).Visible=xlSheetHidden
ExlApp.ActiveWorkbook.PrintOut IgnorePrintAreas:=True
ExlApp.ActiveWorkbook.close SaveChanges:=False
nextline:
ExlApp.Quit
Set ExlApp=Nothing
exit sub
line:
WScript.Echo Err.description
resume nextline
end sub''' ScriptOutput=> VBScriptOutput ScriptError=> ScriptError
END
上面的代码错在哪里?