View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
ducky ducky is offline
external usenet poster
 
Posts: 27
Default Closing sheets and selecting 'no' automatically


Graham Whitehead wrote:
Hi, I have some code which collects data from various different workbooks on
a network then applied some formating and prints them. When the stuff has
been printed I just simply want to close the workbook without saving the
changes. Now even if i set Application.DisplayAlerts to false while this
part runs can I be sure that the default is not to save them, i.e. the focus
is not on the yes button. Does anyone know anything about this. Thanks for
your time


It isn't really a matter of focus on a button, but a matter of
bypassing the 'are you sure?' dialogs.

if you set your alerts to false and your code is programmed to save
your file with a name that already exists, it will overwrite the
existing file - no questions asked

if your alerts are set to false and you close your workbook, it will
not ask if you want to save your changes - no questions asked. (so if
you do, be sure that you have already done so in your code)

hope this helps

AR