How to 'click OK button' automatically in excel

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Help!! This is driving me mad and I cannot find a code anywhere to do it

I have macros that open and close spreadsheets / copy large areas of data and I get the normal "Do you want to save your changes?" and "Do you want to keep the information on the clipboard?" dialogue boxes appearing

What I want my macro to do is to say "Yes" or"No" automatically - without any user interaction (as the answer to these questions will never change - and to be frank it is damn annoying)

Has anyone any idea? I thought I was OK at writing macros until this!!!

Ta very muc
Net
 
To get rid of the "Do you want to save changes" prompt
try this


Private Sub Workbook_BeforeClose(Cancel As Boolean)
Thisworkbook.saved = true 'this closes without saving
application.cutcopymode = false
End Sub
-----Original Message-----
Help!! This is driving me mad and I cannot find a code anywhere to do it!

I have macros that open and close spreadsheets / copy
large areas of data and I get the normal "Do you want to
save your changes?" and "Do you want to keep the
information on the clipboard?" dialogue boxes appearing.
What I want my macro to do is to say "Yes" or"No"
automatically - without any user interaction (as the
answer to these questions will never change - and to be
frank it is damn annoying).
 
Back
Top