Excel宏运行正常,但无法保存xlsx

时间:2017-03-27 15:24:54

标签: excel-vba vba excel

Excel版本:2016,操作系统:Windows 7企业版(64位)

我正在执行下面的.vbs代码来运行我创建的宏(宏名:PV_Data_Prep) -

Option Explicit

On Error Resume Next

Dim args, objExcel


set args = WScript.Arguments
set objExcel = CreateObject("Excel.Application")


objExcel.Workbooks.Open "C:\PV_SP_Data\Work_Portfolio_All_Active_IT_Projects.xlsx"
objExcel.Visible = true

objExcel.Run "PERSONAL.XLSB!PV_Data_Prep"


objExcel.ActiveWorkbook.Save
objExcel.Activeworkbook.Close

objExcel.Quit

Set objExcel = Nothing

WScript.Quit

宏成功运行。运行宏后,无法保存xlsx。 感谢任何帮助!

0 个答案:

没有答案