Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Automatisch beantwoorden vragen

Hallo,

Ik vroeg me af of het mogelijk is om automatische msgboxen in Excel
zoals: Do you want to save the changes...
en dergelijke automatisch te laten beantwoorden.
Dus wil automatisch "ja" of "nee" antwoorden.

Is het mogelijk en zo ja hoe dien ik dit te doen?

Alvast bedankt!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Automatisch beantwoorden vragen

Hi there,

I was wondering if it is possible to automatically answer to msgboxes
like "Do you want to save the changes..."
So i want to answer this question in the VBA code. Is it possible and
if so how?

Thanks!

On 16 mrt, 13:03, wrote:
Hallo,

Ik vroeg me af of het mogelijk is om automatische msgboxen in Excel
zoals: Do you want to save the changes...
en dergelijke automatisch te laten beantwoorden.
Dus wil automatisch "ja" of "nee" antwoorden.

Is het mogelijk en zo ja hoe dien ik dit te doen?

Alvast bedankt!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Automatisch beantwoorden vragen

If your question is:
Prevent or stop the Save Dialog box then put this in ThisWorkbook code:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveWorkbook.Saved = True
End Sub


If your question is how to automatically save without the Dialog box then
put this in ThisWorkbook code:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveWorkbook.Save
End Sub




--
Gary''s Student
gsnu200710


" wrote:

Hallo,

Ik vroeg me af of het mogelijk is om automatische msgboxen in Excel
zoals: Do you want to save the changes...
en dergelijke automatisch te laten beantwoorden.
Dus wil automatisch "ja" of "nee" antwoorden.

Is het mogelijk en zo ja hoe dien ik dit te doen?

Alvast bedankt!


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Automatisch beantwoorden vragen

Much better.

If the user attempts to close the file or exit Excel, The
Workbook_BeforeClose will be activated BEFORE the normal dialog box appears.
You can then insert your own logic:

1. if you want to save, just:
ActiveWorkbook.Save
Exit Sub


2. if you don't want to save:
ActiveWorkbook.Saved=True
Exit Sub

In the second case you are tricking Excel into thinking that workbook has
been saved and thus Excel won't botherr to bring up the dialog box.

--
Gary''s Student
gsnu200710

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Automatisch beantwoorden vragen

Thanks for the quick answer, the problem is that the msgbox Do you
want to save the changes is answered by the code but after that one on
other msgbox appears that says that "There is a large amount of
information on the Clipboard......To save...click Yes"
This question should also be answered automatiacally with Yes can you
help me with that?

On 16 mrt, 13:25, Gary''s Student
wrote:
If your question is:
Prevent or stop the Save Dialog box then put this in ThisWorkbook code:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveWorkbook.Saved = True
End Sub

If your question is how to automatically save without the Dialog box then
put this in ThisWorkbook code:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveWorkbook.Save
End Sub

--
Gary''s Student
gsnu200710



" wrote:
Hallo,


Ik vroeg me af of het mogelijk is om automatische msgboxen in Excel
zoals: Do you want to save the changes...
en dergelijke automatisch te laten beantwoorden.
Dus wil automatisch "ja" of "nee" antwoorden.


Is het mogelijk en zo ja hoe dien ik dit te doen?


Alvast bedankt!- Tekst uit oorspronkelijk bericht niet weergeven -


- Tekst uit oorspronkelijk bericht weergeven -





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Automatisch beantwoorden vragen

try:
Application.DisplayAlerts = False
before the Exit

I don't know if it will work because I can't test it.
--
Gary''s Student
gsnu200710


" wrote:

Thanks for the quick answer, the problem is that the msgbox Do you
want to save the changes is answered by the code but after that one on
other msgbox appears that says that "There is a large amount of
information on the Clipboard......To save...click Yes"
This question should also be answered automatiacally with Yes can you
help me with that?

On 16 mrt, 13:25, Gary''s Student
wrote:
If your question is:
Prevent or stop the Save Dialog box then put this in ThisWorkbook code:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveWorkbook.Saved = True
End Sub

If your question is how to automatically save without the Dialog box then
put this in ThisWorkbook code:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveWorkbook.Save
End Sub

--
Gary''s Student
gsnu200710



" wrote:
Hallo,


Ik vroeg me af of het mogelijk is om automatische msgboxen in Excel
zoals: Do you want to save the changes...
en dergelijke automatisch te laten beantwoorden.
Dus wil automatisch "ja" of "nee" antwoorden.


Is het mogelijk en zo ja hoe dien ik dit te doen?


Alvast bedankt!- Tekst uit oorspronkelijk bericht niet weergeven -


- Tekst uit oorspronkelijk bericht weergeven -




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
automatisch Eingaben mit weiteren Arbeitsblätter verknüpfen Taffis Excel Discussion (Misc queries) 0 August 4th 05 04:29 PM


All times are GMT +1. The time now is 12:19 PM.

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"