Set lstArgs = WScript.Arguments
For I = 0 To lstArgs.Count - 1 ' Loop through each file
FullName = lstArgs(I)
FileName = Left(lstArgs(I), InStrRev(lstArgs(I), ".") )
'Create Excel Objects
MyPath = Left(WScript.ScriptFullName, Len(WScript.ScriptFullName) - Len(WScript.ScriptName))
Set objWS = CreateObject("Excel.application")
Set objWB = objWS.Workbooks.Open(FullName)
Set oVBC = objWB.VBProject.VBComponents
oVBC.Import (MyPath & "LIS.bas")
objWB.Application.Run "LIS2CSV"
objWS.Application.Visible = False
objWS.Application.DisplayAlerts = False
'MsgBox FileName
objWB.SaveAs FileName & "csv", 23
objWB.SaveAs
objWS.Application.Quit
objWS.Quit
'Destroy Excel Objects
Set objWS = Nothing
Set objWB = Nothing
Next
以上代码有效。我可以使用" .lis"类型的文件,将其拖到VBScript上并删除。 Out弹出一个.csv文件都很干净。
我有一个Python脚本,它会出现并收集所有CSV文件并使用它们执行魔术技巧,返回格式化的.xlsx文件。这也有效。
我如何将这两个过程一起修补? May 我将这两个进程一起修补了吗?