Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hie,
I try (unsuccesfully to test if an object of my own is "Nothing" or not I created an object class, let's call it MyClass. Thren I declared an instance of this variable like this: Dim MyObj as new MyClass Dim boTest as boolean Set MyObj = Nothing boTest = MyObj Is Nothing Strangely, boTest is false! (I hoped this test retrun was true) The question is : where did I make a mistake. Thanks for your help. -- Jean-Pierre Bidon Interstat 91 rue de Rennes 75006 Paris Tél: 01 45 49 19 17 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try:
Dim MyObj As myClass Dim boTest As Boolean Set MyObj = New myClass Set MyObj = Nothing boTest = MyObj Is Nothing And then read Chip Pearson's explanation: http://www.cpearson.com/excel/variables.htm Look for: Don't Use The New Keyword In A Dim Statement Jean-Pierre Bidon wrote: Hie, I try (unsuccesfully to test if an object of my own is "Nothing" or not I created an object class, let's call it MyClass. Thren I declared an instance of this variable like this: Dim MyObj as new MyClass Dim boTest as boolean Set MyObj = Nothing boTest = MyObj Is Nothing Strangely, boTest is false! (I hoped this test retrun was true) The question is : where did I make a mistake. Thanks for your help. -- Jean-Pierre Bidon Interstat 91 rue de Rennes 75006 Paris Tél: 01 45 49 19 17 -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Instead of
Dim MyObj as new MyClass use Dim MyObj as MyClass "Jean-Pierre Bidon" wrote: Hie, I try (unsuccesfully to test if an object of my own is "Nothing" or not I created an object class, let's call it MyClass. Thren I declared an instance of this variable like this: Dim MyObj as new MyClass Dim boTest as boolean Set MyObj = Nothing boTest = MyObj Is Nothing Strangely, boTest is false! (I hoped this test retrun was true) The question is : where did I make a mistake. Thanks for your help. -- Jean-Pierre Bidon Interstat 91 rue de Rennes 75006 Paris Tél: 01 45 49 19 17 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Object does not exist. | Excel Discussion (Misc queries) | |||
Command Line. How to tell to XL : If the xls file exist : Open it, if it does not exist : Create it. | Excel Programming | |||
Test if Cell is Empty or Doesn't Exist | Excel Programming | |||
test if a sheet exist (with the name) ? | Excel Programming |