TheWennerWoman
Active Member
- Joined
- Aug 1, 2019
- Messages
- 303
- Office Version
- 365
- Platform
- Windows
Hello,
I have this
"posted" is a public variable that gets flipped to 1 when the data is uploaded to the database correctly.
If I make the worksheet "uploader" very hidden and attempt to close, the code above kicks in when I don't think it should?
I'm guessing my syntax is wrong somewhere?
Thanks as always for any advice!
I have this
VBA Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
With Worksheets("Uploader")
If .Visible And posted = 0 Then MsgBox ("You haven't uploaded data to the database!"), vbCritical
Cancel = True
End With
End Sub
"posted" is a public variable that gets flipped to 1 when the data is uploaded to the database correctly.
If I make the worksheet "uploader" very hidden and attempt to close, the code above kicks in when I don't think it should?
I'm guessing my syntax is wrong somewhere?
Thanks as always for any advice!