Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Whats the equivalent of null in VBA?

It seems that your idea that "work arounds" are required stems from your
misunderstanding the VBA/VB language and what Null means.
To me, outside of a database environment, it does not have a real meaning in
VBA, where you have Nothing for objects and Empty for variants (although you
can use Null with a Variant also) & vbNullString for strings.

Private Sub CommandButton1_Click()
Dim Nullable As Variant

Nullable = "some string"
Nullable = Null
Debug.Print IsNull(Nullable)

Nullable = "some string"
Nullable = Empty
Debug.Print IsNull(Nullable)

Dim NullStr As String
NullStr = "Null String"
NullStr = vbNullString
Debug.Print IsNull(NullStr)

End Sub

NickHK

"vivmaha" wrote in message
...
I'll try all of these work arounds. I'll only be able to test if they work
when my application is 'semi-complete'.

Why are all of these work arounds? Is there no such 'null' as there is in
other languages?

"vivmaha" wrote:

Hi,
I have the following code:
Public parent As Node
Set parent = New Node
parent = Null

This doesnt work (Error 438). The error is on the last line, where I try

to
assign a null value to parent. How do I assign null values to objects in

VBA?

Btw, "Node" is defined as a class module.

Thanks.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Failed to save table attributes of (null) into (null). Luca Brasi Excel Discussion (Misc queries) 2 February 4th 09 04:30 PM
whats it do Curt Excel Discussion (Misc queries) 14 April 13th 07 07:53 PM
Null, "null", vbNull, vbNullString, vbEmpty [email protected] Excel Programming 2 July 25th 06 01:28 PM
I don't get it, Whats going on here? CodeSponge[_2_] Excel Programming 3 February 8th 05 04:19 PM
Whats the equivalent for NETWORKDAYS in VBA for excel ? sorabh Excel Programming 2 June 4th 04 10:21 PM


All times are GMT +1. The time now is 11:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"