PC Review


Reply
Thread Tools Rate Thread

Answering pop-up question

 
 
=?Utf-8?B?TWF0dA==?=
Guest
Posts: n/a
 
      24th Oct 2006
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 With Quote
 
 
 
 
darrenmcconachie
Guest
Posts: n/a
 
      24th Oct 2006
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 <M...@discussions.microsoft.com> 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 With Quote
 
Andrew Taylor
Guest
Posts: n/a
 
      24th Oct 2006
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 With Quote
 
=?Utf-8?B?Z2FsaW1p?=
Guest
Posts: n/a
 
      24th Oct 2006
Matt,

You can use the Application.DisplayAlerts = False property. You can set it
to True after you have completed a dialog box action.
--
http://HelpExcel.com
(E-Mail Removed)
516-984-0252


"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 With Quote
 
=?Utf-8?B?TWF0dA==?=
Guest
Posts: n/a
 
      24th Oct 2006
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 <M...@discussions.microsoft.com> 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 With Quote
 
=?Utf-8?B?TWF0dA==?=
Guest
Posts: n/a
 
      24th Oct 2006
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!

 
Reply With Quote
 
=?Utf-8?B?TWF0dA==?=
Guest
Posts: n/a
 
      24th Oct 2006
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 With Quote
 
Andrew Taylor
Guest
Posts: n/a
 
      24th Oct 2006
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
thanks for not answering question#2 Stan Starinski Windows Vista General Discussion 4 21st Dec 2009 05:47 PM
thanks for not answering question#2 Stan Starinski Windows Vista Hardware 2 21st Dec 2009 05:29 PM
Re: Thanks for not answering my question Blanche Starinski Windows Vista General Discussion 0 10th Dec 2009 10:36 PM
Answering your own question. Weeble Microsoft Access Forms 1 30th Nov 2009 02:51 PM
Re: Answering your own question. Gina Whipp Microsoft Access Forms 0 25th Nov 2009 08:19 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:38 AM.