Hi
I have this code
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.ScreenUpdating = False
Sheets("Sheet1").Select
Let d$ = Range("A40")
If d$ = True Then
If ThisWorkbook.ReadOnly = False Then
ActiveWorkbook.Save
Else
MsgBox "I'm read only, cannot save."
ThisWorkbook.Saved = True
End If
Else
ThisWorkbook.Close False
End If
End Sub
In the thisworkbook section of my workbook. Which has worked fine for months.
When I click the x to close the workbook, it saves itself and does not ask me.
Now I have added a section which incorporates a sendkeys command.
SendKeys Filename & "{ENTER}", False
When the module with sendkeys in is run and I click the x to close the workbook, it asks me if I want to save the book.
I cannot see what else it could be but is there any workaround this?
Thanks
Bookmarks