Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Auto close the prompt & dialog boxes

Hello, Excel Experts:

I need help to auto close prompts & Dialog boxes for saving change. My
program opens one
workbook, sort the data on one sheet and then copy the selection, then
open another workbook to paste the data on one of the sheet. My
problem is that the excel won't let me close the first workbook without
showing two dialogue boxes- one is asking is the user if he wants to
save the change before closing the book, another dialog box is asking
the user if he wants to save or clear the data in the clipboard. For
both message, the user should click the "no" button. I want to write
some code to close these dialog boxes automatically or prevent them to
appear.

I have tried to run some Micros to see if it will show me the code, but
no success. Does anyone know how to do that? I really appreciate any
help or suggestions. Thank you very much.

KHW

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Auto close the prompt & dialog boxes

application.CutCopyMode = False
Activeworkbook.Close Savechanges:=False


Or nest your current code in

application.DisplayAlerts = False


application.Displayalerts = True
--
Regards,
Tom Ogilvy


"HelpEachOther" wrote in message
oups.com...
Hello, Excel Experts:

I need help to auto close prompts & Dialog boxes for saving change. My
program opens one
workbook, sort the data on one sheet and then copy the selection, then
open another workbook to paste the data on one of the sheet. My
problem is that the excel won't let me close the first workbook without
showing two dialogue boxes- one is asking is the user if he wants to
save the change before closing the book, another dialog box is asking
the user if he wants to save or clear the data in the clipboard. For
both message, the user should click the "no" button. I want to write
some code to close these dialog boxes automatically or prevent them to
appear.

I have tried to run some Micros to see if it will show me the code, but
no success. Does anyone know how to do that? I really appreciate any
help or suggestions. Thank you very much.

KHW



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Auto close the prompt & dialog boxes

As originally stated:

Application.CutCopyMode = False

clears the clipboard if it holds a range copied from Excel.

or to suppress the prompt

Application.DisplayAlerts = False

' code that would produce a prompt

Application.DisplayAlerts = True

--
Regards,
Tom Ogilvy


"Tom Ogilvy" wrote in message
...
application.CutCopyMode = False
Activeworkbook.Close Savechanges:=False


Or nest your current code in

application.DisplayAlerts = False


application.Displayalerts = True
--
Regards,
Tom Ogilvy


"HelpEachOther" wrote in message
oups.com...
Hello, Excel Experts:

I need help to auto close prompts & Dialog boxes for saving change. My
program opens one
workbook, sort the data on one sheet and then copy the selection, then
open another workbook to paste the data on one of the sheet. My
problem is that the excel won't let me close the first workbook without
showing two dialogue boxes- one is asking is the user if he wants to
save the change before closing the book, another dialog box is asking
the user if he wants to save or clear the data in the clipboard. For
both message, the user should click the "no" button. I want to write
some code to close these dialog boxes automatically or prevent them to
appear.

I have tried to run some Micros to see if it will show me the code, but
no success. Does anyone know how to do that? I really appreciate any
help or suggestions. Thank you very much.

KHW





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dialog prompt during opening of file markuss New Users to Excel 1 June 21st 06 11:32 AM
How do I prompt a user with a dialog box [email protected] Excel Programming 0 November 22nd 05 04:55 PM
How Close Excel from CMD prompt? Al Franz Excel Programming 5 August 20th 05 09:14 PM
Automatically Close Dialog Boxes chriskane Excel Worksheet Functions 2 August 9th 05 12:14 PM
Save Changes Prompt at close Johnewally Excel Discussion (Misc queries) 2 March 17th 05 09:15 PM


All times are GMT +1. The time now is 08:51 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"