How to Disable Visio Alert Dialogs? - (Application.AlertResponse)
-
Wednesday, February 22, 2012 8:53 PM
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
- Moved by Max MengMicrosoft Contingent Staff Thursday, February 23, 2012 5:24 AM Moving to a more appropriate forum (From:Visio General Questions and Answers for IT Professionals)
All Replies
-
Monday, February 27, 2012 8:23 AMModerator
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
-
Monday, February 27, 2012 10:33 AM
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
- Proposed As Answer by Bruce SongModerator Thursday, March 01, 2012 8:49 AM
- Marked As Answer by Bruce SongModerator Friday, March 02, 2012 4:18 AM
-
Thursday, March 01, 2012 8:50 AMModeratorSeve, 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

