我为一个按钮分配了一个宏,该按钮应该保存任何更改,然后只关闭thisworkbook
。但是,当它在保存并关闭后运行时,它会立即开始再次下载工作簿。
这是代码:
Sub SaveAndClose()
Dim wb As Workbook
Set wb = ThisWorkbook 'setting workbook
wb.Save 'saving workbook
wb.Close (True) ' closing workbook
Application.Quit 'shutting down Excel
End Sub
谢谢你的帮助。
执行以下操作:
Sub SaveAndClose()
Application.Quit 'shutting down Excel
Dim wb As Workbook
Set wb = ThisWorkbook 'setting workbook
wb.Save 'saving workbook
wb.Close (True) ' closing workbook
End Sub