Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 516
Default Answering pop-up question

Is there a way to automatically answer questions that pop up as you are
manipulating files? For example, after performing specific functions to a
file, I have it close, but then the questoin comes up "Would you like to save
the changes you have made to file ABC?" - and the answer will always be
yes...so is there a way to code for that? Thanks in advance!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Answering pop-up question

Have you used VBA macros before?

In the ThisWorkbook module use the beforeClose event and force the
save. If you need help implementing this let me know. If there are no
macros already in the workbook this will create an extra question on
opening the book involving Macro security. There are 2 ways round this,
but let's deal with one question at a time!

Darren

On Oct 24, 1:47 pm, Matt wrote:
Is there a way to automatically answer questions that pop up as you are
manipulating files? For example, after performing specific functions to a
file, I have it close, but then the questoin comes up "Would you like to save
the changes you have made to file ABC?" - and the answer will always be
yes...so is there a way to code for that? Thanks in advance!


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 225
Default Answering pop-up question

For saving and closing a workbook the best way is to use the
SaveChanges parameter of the Workbook.Close method:

ActiveWorkbook.Close SaveChanges:=True

You can also prevent certain prompts by using
Application.DisplayAlerts, e.g.

Application.DisplayAlerts = False
ActiveWorkbook.Sheets(1).Delete ' prevents "are you sure?" prompt
ActiveWorkbook.SaveAs "c:\junk.xls" ' prevents prompt if file
exists
Application.DisplayAlerts = True ' reset prompts

hth
Andrew


Matt wrote:
Is there a way to automatically answer questions that pop up as you are
manipulating files? For example, after performing specific functions to a
file, I have it close, but then the questoin comes up "Would you like to save
the changes you have made to file ABC?" - and the answer will always be
yes...so is there a way to code for that? Thanks in advance!


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 516
Default Answering pop-up question

Hello Darren - thanks for the reply - I am using this in a VBA macro - but
I'm not familiar with the beforeClose event and forcing the save....so any
guidance on the coding would be greatly appreciated!

Thanks!

"darrenmcconachie" wrote:

Have you used VBA macros before?

In the ThisWorkbook module use the beforeClose event and force the
save. If you need help implementing this let me know. If there are no
macros already in the workbook this will create an extra question on
opening the book involving Macro security. There are 2 ways round this,
but let's deal with one question at a time!

Darren

On Oct 24, 1:47 pm, Matt wrote:
Is there a way to automatically answer questions that pop up as you are
manipulating files? For example, after performing specific functions to a
file, I have it close, but then the questoin comes up "Would you like to save
the changes you have made to file ABC?" - and the answer will always be
yes...so is there a way to code for that? Thanks in advance!





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 516
Default Answering pop-up question

Thank you both galimi and Andrew....very helpful!

"Matt" wrote:

Is there a way to automatically answer questions that pop up as you are
manipulating files? For example, after performing specific functions to a
file, I have it close, but then the questoin comes up "Would you like to save
the changes you have made to file ABC?" - and the answer will always be
yes...so is there a way to code for that? Thanks in advance!

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 516
Default Answering pop-up question

What if you want to not have the message:

"There is a large amount of information on the Clipboard. Would you like
it...blah blah"

come up?

Thanks again

"Andrew Taylor" wrote:

For saving and closing a workbook the best way is to use the
SaveChanges parameter of the Workbook.Close method:

ActiveWorkbook.Close SaveChanges:=True

You can also prevent certain prompts by using
Application.DisplayAlerts, e.g.

Application.DisplayAlerts = False
ActiveWorkbook.Sheets(1).Delete ' prevents "are you sure?" prompt
ActiveWorkbook.SaveAs "c:\junk.xls" ' prevents prompt if file
exists
Application.DisplayAlerts = True ' reset prompts

hth
Andrew


Matt wrote:
Is there a way to automatically answer questions that pop up as you are
manipulating files? For example, after performing specific functions to a
file, I have it close, but then the questoin comes up "Would you like to save
the changes you have made to file ABC?" - and the answer will always be
yes...so is there a way to code for that? Thanks in advance!



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 225
Default Answering pop-up question

Try using
Application.CutCopyMode = False
before closing the workbook

Matt wrote:
What if you want to not have the message:

"There is a large amount of information on the Clipboard. Would you like
it...blah blah"

come up?

Thanks again

"Andrew Taylor" wrote:

For saving and closing a workbook the best way is to use the
SaveChanges parameter of the Workbook.Close method:

ActiveWorkbook.Close SaveChanges:=True

You can also prevent certain prompts by using
Application.DisplayAlerts, e.g.

Application.DisplayAlerts = False
ActiveWorkbook.Sheets(1).Delete ' prevents "are you sure?" prompt
ActiveWorkbook.SaveAs "c:\junk.xls" ' prevents prompt if file
exists
Application.DisplayAlerts = True ' reset prompts

hth
Andrew


Matt wrote:
Is there a way to automatically answer questions that pop up as you are
manipulating files? For example, after performing specific functions to a
file, I have it close, but then the questoin comes up "Would you like to save
the changes you have made to file ABC?" - and the answer will always be
yes...so is there a way to code for that? Thanks in advance!




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
Hiding, or automatically answering, a confirmation msgbox Brian Beck Excel Discussion (Misc queries) 1 July 28th 06 04:11 PM
Excel help needs an article answering, "What is a pivot table?" Boris The Pizza Bear Excel Discussion (Misc queries) 1 September 26th 05 03:09 AM
Answering a question in a cell Salesmaster Excel Worksheet Functions 2 July 16th 05 10:33 PM
Answering InpBox prompt lashio Excel Discussion (Misc queries) 4 June 24th 05 02:25 AM
Automatically answering no to save request James Hess Excel Programming 2 July 1st 04 10:24 PM


All times are GMT +1. The time now is 09:33 AM.

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

About Us

"It's about Microsoft Excel"