The information in this article applies to:
SYMPTOMSIn Microsoft Excel version 5.0 for Windows, if you use the Visual Basic for Applications "Is" function incorrectly, you may receive a general protection (GP) fault. MORE INFORMATION
The "Is" function is used to compare two object reference variables. The
result of an Is operation is either TRUE (if the variables both refer to
the same object) or FALSE (if they do not).
All of these commands will return the value TRUE:
Alpha Is CharlieNote that Bravo Is <object>, where <object> is Alpha, Charlie, or Delta, will return FALSE, because the value of Bravo is not the same as the value of Alpha, Charlie, or Delta, even though they both refer to the same object. If you use the "Is" function to compare a valid object reference (for example, Alpha) to an invalid object reference (for example, a numeric value, a string, or any other item that is not an object), you may receive a GP fault. To prevent this error from occurring, make sure both items being compared are valid objects. Visual Basic Code ExampleMicrosoft provides examples of Visual Basic for Applications procedures 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. The Visual Basic procedures in this article are provided 'as is' and Microsoft does not guarantee that they can be used in all situations. While Microsoft support professionals can help explain the functionality of a particular macro, they will not modify these examples to provide added functionality, nor will they help you construct macros to meet your specific needs. If you have limited programming experience, you may want to consult one of the Microsoft Solution Providers. Solution Providers offer a wide range of fee-based services, including creating custom macros. For more information about Microsoft Solution Providers, call Microsoft Customer Information Service at (800) 426-9400.The following code example illustrates the proper use of the "Is" function. To run this example, position the cursor in the line that reads "Sub GoodIsSubroutine()" and either press the F5 key or choose Start from the Run menu.
When you run GoodIsSubroutine, you will be shown three message boxes,
one for each of the "Is" functions that succeeds.
Additional query words: hang stop responding gpf
Keywords : kbprg |
Last Reviewed: October 19, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |