ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Automatisch beantwoorden vragen (https://www.excelbanter.com/excel-programming/385414-automatisch-beantwoorden-vragen.html)

[email protected]

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!


[email protected]

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!




Gary''s Student

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!



Gary''s Student

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


[email protected]

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 -




Gary''s Student

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 -





Dave Peterson

Automatisch beantwoorden vragen
 
application.cutcopymode = false


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 -


--

Dave Peterson

Gary''s Student

Automatisch beantwoorden vragen
 
Thanks Dave - that's good to know.
--
Gary''s Student
gsnuxx


"Dave Peterson" wrote:

application.cutcopymode = false


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 -


--

Dave Peterson



All times are GMT +1. The time now is 04:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com