How to Disable Visio Alert Dialogs? - (Application.AlertResponse)
-
mercredi 22 février 2012 20:53
I successfully linked Visio Shapes to an Excel range using the Data Wizard. I then automated the Update with this code:
Public Sub DoUpdate()
Dim vAddon As Visio.AddonApplication.ActiveWindow.DeselectAll
Set vAddon = Visio.Addons("Database Update")
Application.AlertResponse = 6 `IDYES
vAddon.Run ("")Application.AlertResponse = 0
End SubThe code runs fine (with many Alerts) with the AlertResponse lines commented out. However, when AlertResponse = 6 is active, the Visio Shapes de-link from the database and I think corrupt it somehow. I had to destroy the database and recreate it to successfully re-link the Shapes to the Excel data range.
Am I using the wrong AlertResponse assignment for this action?
Any ideas?
Thanks.
Steve Mack
- Déplacé Max MengMicrosoft Contingent Staff jeudi 23 février 2012 05:24 Moving to a more appropriate forum (From:Visio General Questions and Answers for IT Professionals)
Toutes les réponses
-
lundi 27 février 2012 08:23Modérateur
Hi Steve Mack,
Thank you for posting.
>>The code runs fine (with many Alerts) with the AlertResponse lines commented out
Why did you get many alerts if the AlertResponse lines were commented out? I didn't get on my side.Here is the article which describes the AlertResponse:
Hope this can help you.
Best Regards,
Bruce Song [MSFT]
MSDN Community Support | Feedback to us
-
lundi 27 février 2012 10:33
Bruce,
Thanks for the reply.
Re: "Why did you get many alerts if the AlertResponse lines were commented out? I didn't get on my side."
You sort of lost me here because the default is Alerts are active right? With the suppression code commented out, they should appear. (And they do. One Alert for each data record change.)
To close on this, I originally set AlertResponse = 6 (IDYES) because the Alert dialog box presents Yes/No buttons. However, I changed the code to AlertResponse = 1 (IDOK) instead and that appears to solve the problem.
Steve Mack
- Proposé comme réponse Bruce SongModerator jeudi 1 mars 2012 08:49
- Marqué comme réponse Bruce SongModerator vendredi 2 mars 2012 04:18
-
jeudi 1 mars 2012 08:50ModérateurSeve, glad to hear that you have figured out the problem and share it with us. Thank you very much.
Best Regards,Bruce Song [MSFT]
MSDN Community Support | Feedback to us

