How to Disable Visio Alert Dialogs? - (Application.AlertResponse)

Answered 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.Addon

        Application.ActiveWindow.DeselectAll

        Set vAddon = Visio.Addons("Database Update")
        Application.AlertResponse = 6 `IDYES
        vAddon.Run ("")

        Application.AlertResponse = 0

    End Sub

    The 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 AM
    Moderator
     
     

    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:

    http://office.microsoft.com/client/helppreview14.aspx?AssetId=HV080350116&lcid=1033&NS=VISIO%2EDEV&Version=14&tl=2&respos=0&CTT=1&queryid=4d79d6a6%2D61da%2D4f39%2D9b3b%2D3d1b1dcaf2a6

    Hope this can help you.

    Best Regards,


    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us

  • Monday, February 27, 2012 10:33 AM
     
     Answered

    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

  • Thursday, March 01, 2012 8:50 AM
    Moderator
     
     
    Seve, 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