用vbs:第一次程序执行时,先打开a.xls,再打开b.xls。第n次执行时,不关...
发布网友
发布时间:2024-05-29 09:01
我来回答
共1个回答
热心网友
时间:2024-07-16 01:28
Dim patch,objExcelApp
Set objExcelApp = Getobject(, "Excel.Application")
patch= "D:\work\b2.xls"
’在此添加一句,将book2,也就是你打开D:\work\b.xls时,将它赋值给变量: book2=objExcelApp.open("D:\work\b.xls")
book2.Active()'激活
objExcelApp.ActiveWorkbook.SaveAs patch
objExcelApp.Workbooks.Close
objExcelApp.Quit
Set objExcelApp= Nothing
张志晨:或者
book2.SaveAs patch