Close worbook vba not working. (2 Viewers)

MsAccessNL

Member
Local time
Today, 20:41
Joined
Aug 27, 2022
Messages
209
Sub Closethis()
Thisworkbook.close
End sub

Doesn’t work if this sub is called from another function or from an event. Only if you run it direct. Chat said to run the code on time, but also nothing.

I have code to check for a value otherwise it will close the workbook. Any ideas to get this working?
 
Try Renaming your Closethis() sub to anything other than that name, ie:

Sub subCloseThis()
Thisworkbook.Close
End Sub
 
Can you give an example of the calling code - the full calling code?
You might consider using true or false for saving
 

Users who are viewing this thread

  • Back
    Top Bottom