ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Checking user defined types for Nothing (https://www.excelbanter.com/excel-programming/360484-checking-user-defined-types-nothing.html)

jayklmno

Checking user defined types for Nothing
 
I have a user defined type that is not getting initialized under a certain
procedure and when it gets to a point, I need to check and see if it has been
initialized. I acnnot get any combination of Is Nothing, IsNull or anything
else I can think of to get it to discover if the UDT = Nothing.

Any suggestions?

Tom Ogilvy

Checking user defined types for Nothing
 
You would have to check the individual elements I would think.

a UDT is not an object, so is nothing wouldn't work.

--
Regards,
Tom Ogilvy



"jayklmno" wrote:

I have a user defined type that is not getting initialized under a certain
procedure and when it gets to a point, I need to check and see if it has been
initialized. I acnnot get any combination of Is Nothing, IsNull or anything
else I can think of to get it to discover if the UDT = Nothing.

Any suggestions?


jayklmno

Checking user defined types for Nothing
 
When I check an element, like ubound() I get a subscript error and it tells
me ubound(UDT) = nothing.

Is there a way to phrase the ubound statement that won't bomb out the code?

"Tom Ogilvy" wrote:

You would have to check the individual elements I would think.

a UDT is not an object, so is nothing wouldn't work.

--
Regards,
Tom Ogilvy



"jayklmno" wrote:

I have a user defined type that is not getting initialized under a certain
procedure and when it gets to a point, I need to check and see if it has been
initialized. I acnnot get any combination of Is Nothing, IsNull or anything
else I can think of to get it to discover if the UDT = Nothing.

Any suggestions?


Chip Pearson

Checking user defined types for Nothing
 
UBound is used only for arrays, not user defined types.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"jayklmno" wrote in message
...
When I check an element, like ubound() I get a subscript error
and it tells
me ubound(UDT) = nothing.

Is there a way to phrase the ubound statement that won't bomb
out the code?

"Tom Ogilvy" wrote:

You would have to check the individual elements I would think.

a UDT is not an object, so is nothing wouldn't work.

--
Regards,
Tom Ogilvy



"jayklmno" wrote:

I have a user defined type that is not getting initialized
under a certain
procedure and when it gets to a point, I need to check and
see if it has been
initialized. I acnnot get any combination of Is Nothing,
IsNull or anything
else I can think of to get it to discover if the UDT =
Nothing.

Any suggestions?




jayklmno

Checking user defined types for Nothing
 
This user defined type is an array. Ubound works normally on this if it is
intialized, but since it's not been intialized, how do I test that?

"Chip Pearson" wrote:

UBound is used only for arrays, not user defined types.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"jayklmno" wrote in message
...
When I check an element, like ubound() I get a subscript error
and it tells
me ubound(UDT) = nothing.

Is there a way to phrase the ubound statement that won't bomb
out the code?

"Tom Ogilvy" wrote:

You would have to check the individual elements I would think.

a UDT is not an object, so is nothing wouldn't work.

--
Regards,
Tom Ogilvy



"jayklmno" wrote:

I have a user defined type that is not getting initialized
under a certain
procedure and when it gets to a point, I need to check and
see if it has been
initialized. I acnnot get any combination of Is Nothing,
IsNull or anything
else I can think of to get it to discover if the UDT =
Nothing.

Any suggestions?





Chip Pearson

Checking user defined types for Nothing
 
Post your code.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"jayklmno" wrote in message
...
This user defined type is an array. Ubound works normally on
this if it is
intialized, but since it's not been intialized, how do I test
that?

"Chip Pearson" wrote:

UBound is used only for arrays, not user defined types.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"jayklmno" wrote in
message
...
When I check an element, like ubound() I get a subscript
error
and it tells
me ubound(UDT) = nothing.

Is there a way to phrase the ubound statement that won't
bomb
out the code?

"Tom Ogilvy" wrote:

You would have to check the individual elements I would
think.

a UDT is not an object, so is nothing wouldn't work.

--
Regards,
Tom Ogilvy



"jayklmno" wrote:

I have a user defined type that is not getting
initialized
under a certain
procedure and when it gets to a point, I need to check
and
see if it has been
initialized. I acnnot get any combination of Is Nothing,
IsNull or anything
else I can think of to get it to discover if the UDT =
Nothing.

Any suggestions?








All times are GMT +1. The time now is 12:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com