Richard Briggs
Richard Briggs

Reputation: 423

Application.Interactive = True fails

In the worksheet SelectionChange event I set :

Application.Interactive = False
.... do work
Application.Interactive = True

For some reason Interactive is not getting set back to true, even though I know the code is being executed.

Excel 2013

Any ideas?

Upvotes: 3

Views: 2335

Answers (1)

user2140173
user2140173

Reputation:

Sub Main()

    Debug.Print Application.Interactive
    Application.Interactive = False
    Debug.Print Application.Interactive
    Application.Interactive = True
    Debug.Print Application.Interactive

End Sub

Doesn't fail for me... Try that and see more here

Since you've discovered the reason for failing the conclusion could be that the Application.Volatile needs to be set to false on a function that uses it because the Interactive mode blocks the user interface and the Volatile calculates things based on user input. While the user input is blocked you can't expect a function that evaluates the user input to work. One excludes the other - hope that makes sense.

Additionally, check your on error resume next or on error goto <label> statements as the would cause skipping some of the code therefore the Application.Interactive = True would have never get executed.

Upvotes: 2

Related Questions