If you forget to reset the property to
True, or encounter an
error in the execution of the code, shut down
that instance of Microsoft Excel and fix the line of code that caused the
error.
To do this, press CTRL+ALT+DELETE and end the Microsoft Excel task.
Sample Visual Basic Procedure
Microsoft provides programming examples for illustration only, without warranty either
expressed or implied, including, but not limited to, the implied warranties of
merchantability and/or fitness for a particular purpose. This article assumes
that you are familiar with the programming language being demonstrated and the
tools used to create and debug procedures. Microsoft support professionals can
help explain the functionality of a particular procedure, but they will not
modify these examples to provide added functionality or construct procedures to
meet your specific needs.
If you have limited programming experience, you may
want to contact a Microsoft Certified Partner or Microsoft Advisory Services. For more information, visit these Microsoft Web sites:
Microsoft Certified
Partners -
https://partner.microsoft.com/global/30000104Microsoft Advisory Services -
http://support.microsoft.com/gp/advisoryservice
For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:
http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS
If it is necessary to enable user input to Microsoft Excel without
restarting the program, you can reset the property, using Automation,
through a Visual Basic for Applications macro.
NOTE: The success of the following macro depends on the ability to open a separate instance of Excel. In Excel 2000, you cannot start a separate instance of Excel, and therefore must run the macro from another program.
The method for opening a separate instance of Excel varies, depending on the operating system.
Windows 2000
- Click Start, and then click Run.
- Type the full path to Microsoft Excel in the Open box -- for
example, c:\Excel\Excel.exe -- and then press ENTER.
- Point to Macro on the Tools menu, and then click
Visual Basic Editor.
After starting a separate instance of Microsoft Excel, follow these steps:
- On the Insert menu, click Module.
- Type the following code in the Module sheet.
Sub reset_interactive()
Dim xlobj As Object
' The GetObject method will access the open instance of Microsoft
' Excel, not a new one.
Set xlobj = GetObject("Book1")
' Where book1 is the name of the Workbook that has stopped
' responding to user input. Make sure to leave the extension,
' .xls, .xlt, and so on, off.
' Because the above line assigns the first Worksheet of book1 to
' xlobj, we must access the Application property of the object in
' order to reset the Interactive property.
xlobj.Application.Interactive = True
End Sub
- To run the macro, click the insertion point in the macro code, and then press F5.