当工作簿即将关闭时,这段代码会被执行,将Saved属性设置为True,从而避免保存提示。 方法二:使用Workbook.Close方法并指定SaveChanges参数为False 直接调用Workbook.Close方法,并设置SaveChanges参数为False,可以关闭工作簿而不保存更改。 vba Sub CloseWorkbookWithoutSaving() ThisWorkbook.Close SaveChanges:=False End Sub ...
In Microsoft Excel, you can create a Microsoft Visual Basic for Applications (VBA) macro that suppresses theSave Changesprompt when you close a workbook. This can be done either by specifying the state of the workbookSavedproperty, or by ...
Step 7:Close the workbook without saving anything Here is a sample of what you will find in lchapter14 of the downloadableTutorial on Excel macros VBA Code for Workbooks To develop a VBA procedure that is triggered by an event relating to the workbook (when you open it, when you save it...
问运行VBA宏时Excel意外关闭(但仅偶尔)EN在Word中,按Alt+F11组合键打开VBE,然后在“工程 – Project...
Close a powershell window when called from a batch file Close all popups pulled from running a an executable Close Excel com object without saving changes? Close Form cluster name using powershell cmd batch launch powershell script and getting environment variables set by powershell script cmdlet...
If you want to close the workbook within which your VBA procedure (macro) runs without saving it you will write these two lines of code: ThisWorkbook.Saved=True ThisWorkbook.Close Verifying the existence of a file When you want to verify if a certain file exists on your disk you will use...
If a workbook has never been saved, itsPathproperty returns an empty string (""). You can set this property toTrueif you want to close a modified workbook without either saving it or being prompted to save it. Example This example displays a message if the active workbook contains unsaved...
If a workbook has never been saved, its Path property returns an empty string (""). You can set this property to True if you want to close a modified workbook without either saving it or being prompted to save it. Example This example displays a message if the active workbook contains ...
true if no changes have been made to the workbook since it was last saved; otherwise, false. Remarks If a workbook has never been saved, its Path property returns an empty string (""). You can set this property to true if you want to close a modified workbook without either saving it...
If a workbook has never been saved, its Path property returns an empty string ("").You can set this property to True if you want to close a modified workbook without either saving it or being prompted to save it.ExampleThis example displays a message if the active workbook contains ...