嗨,我在 Excel 表上使用 VBScript 编写了一些代码,如下所示。现在,每当脚本完成处理时,它都会提示用户使用它Save
。但我不想要这个,而是希望它在没有提示的情况下自动保存。
代码
Option Explicit
Dim objExcel1,strPathExcel1,objSheet1,objSheet5
Set objExcel1 = CreateObject("Excel.Application")'Object for Condition Dump
strPathExcel1 = "D:\VA\GE_Wing_To_Wing_Report.xlsx"
objExcel1.Workbooks.Open strPathExcel1
Set objSheet1 = objExcel1.ActiveWorkbook.Worksheets(1)
Set objSheet5 = objExcel1.ActiveWorkbook.Worksheets(5)
'=====================================================================================
'Here Bad sheet will be copied by the data from First sheet master data sheet
'=====================================================================================
ParentPIDFromMasterSheet objSheet1,objSheet5
'=====================================================================================
'Here Bad sheet will be copied by the data from First sheet master data sheet
'=====================================================================================
BadDataSelectionDel objSheet5
'=======================
objExcel1.ActiveWorkbook.SaveAs strPathExcel1
objExcel1.Workbooks.close
objExcel1.Application.Quit
'======================