我想在运行代码之前检查文件是否已经存在.如果它存在而不是退出,否则保持我的代码运行.我写的是以下代码:
Private Sub CommandButton21_Click()
If FileFolderExists("C:\Users\Moez\Desktop\Macro_Project\Test1.pptm") Then
MsgBox "Modification already done!"
Else
deleteTextBox
AllBlackAndDate
LastModifiedDate
SaveAllPresentations "C:\Users\Moez\Desktop\Macro_Project\Test1.pptm" ' save here
End If
End Sub
Run Code Online (Sandbox Code Playgroud)