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

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

    • 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:23
    Modé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:

    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

  • lundi 27 février 2012 10:33
     
     Traitée

    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

  • jeudi 1 mars 2012 08:50
    Modérateur
     
     
    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