Sunday, March 02, 2008

Disallow user interaction - Excel VBA

Allow / Disallow user interaction in Excel VBA

Sub Hold_User_Interaction()

Application.Interactive = False

' Do necessary calculations / processing

Application.Interactive = True

End Sub

Application.Interactive is True if Microsoft Excel is in interactive mode; this property is usually True. If you set the this property to False, Microsoft Excel will block all input from the keyboard and mouse (except input to dialog boxes that are displayed by your code). Blocking user input will prevent the user from interfering with the macro as it moves or activates Microsoft Excel objects. Read/write Boolean.


This property is useful if you're using DDE or OLE Automation to communicate with Microsoft Excel from another application.

If you set this property to False, don't forget to set it back to True. Microsoft Excel won't automatically set this property back to True when your macro stops running.


  1. Anonymous6:01 AM

    windows7 doesn't work

    1. It worked for me using Windows 7 Pro SP1 and Excel 2010.

  2. I had this problem if not being able to turn on Interactive mode because my Interactive= true seemed to be not working at all...
    after an hour of trying everything, I just accidentally reran the whole macro without debugging on and this time it worked!


Share on Facebook
Related Posts Plugin for WordPress, Blogger...

Visual Basic for Applications (VBA) Forum (recent threads)

CodeKeep VBA Feed

Visual Studio Tools for Office Forum (recent threads)

Download Windows Live Toolbar and personalize your Web experience! Add custom buttons to get the information you care about most.

Office Business Applications (OBA) Team Blog

MSDN Code Gallery Published Resources For Tag VSTO Google Group