MistakesWereMade
Board Regular
- Joined
- May 22, 2019
- Messages
- 103
My program opens a spreadsheet. I want to close this one using the x symbol without asking me if I'd like to close all other spreadsheets.
I have this written in my ThisWorkbook coding section.
I want the workbook associated with swb to remain open and not asked to be canceled. I have a separate button in my userform that is used to close this workbook.
I have this written in my ThisWorkbook coding section.
Code:
Public swb As String
Private Sub Workbook_Open()
Application.ScreenUpdating = False
swb = ThisWorkbook.Name
ThisWorkbook.Application.Visible = False
Application.ScreenUpdating = True
SplashUserForm.Show
End Sub
Private Sub WbkClose()
If swb <> ActiveWorkbook.Name Then
ActiveWorkbook.Close = True
ThisWorkbook.Close = False
End If
End Sub
I want the workbook associated with swb to remain open and not asked to be canceled. I have a separate button in my userform that is used to close this workbook.