Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to test if a workbook variable is valid
Hi,
When using a variable of type workbook in an expression, it is necessary to test if its content is valid. For instance that it is not "nothing". However syntaxes like "if wb < nothing then ..." or "if not wb=nothing then ...." do not work. Is there any solution, possibly with a different approach. Thank you in advance. Jean-Pierre B |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to test if a workbook variable is valid
Jean-Pierre,
How about IF LEN(VariableName) = 0 (to test for a blank string) Regards Pete "Jean-Pierre Bidon" wrote: Hi, When using a variable of type workbook in an expression, it is necessary to test if its content is valid. For instance that it is not "nothing". However syntaxes like "if wb < nothing then ..." or "if not wb=nothing then ...." do not work. Is there any solution, possibly with a different approach. Thank you in advance. Jean-Pierre B |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to test if a workbook variable is valid
Thanks for your help, but the len() function requires an argument of type
string . Actually, I got the answer in the mean time. The syntax I used at first was not good "if wb < nothing then ..." . The right syntax is "if wb is nothing then ...". Thanks. Best regards. Jean-Pierre "Peter Rooney" a écrit dans le message de news: ... Jean-Pierre, How about IF LEN(VariableName) = 0 (to test for a blank string) Regards Pete "Jean-Pierre Bidon" wrote: Hi, When using a variable of type workbook in an expression, it is necessary to test if its content is valid. For instance that it is not "nothing". However syntaxes like "if wb < nothing then ..." or "if not wb=nothing then ...." do not work. Is there any solution, possibly with a different approach. Thank you in advance. Jean-Pierre B |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to test if a workbook variable is valid
Oops - that'll teach me to read the question properly - it's a bit late in
the day. Sorry Pete "Jean-Pierre Bidon" wrote: Thanks for your help, but the len() function requires an argument of type string . Actually, I got the answer in the mean time. The syntax I used at first was not good "if wb < nothing then ..." . The right syntax is "if wb is nothing then ...". Thanks. Best regards. Jean-Pierre "Peter Rooney" a écrit dans le message de news: ... Jean-Pierre, How about IF LEN(VariableName) = 0 (to test for a blank string) Regards Pete "Jean-Pierre Bidon" wrote: Hi, When using a variable of type workbook in an expression, it is necessary to test if its content is valid. For instance that it is not "nothing". However syntaxes like "if wb < nothing then ..." or "if not wb=nothing then ...." do not work. Is there any solution, possibly with a different approach. Thank you in advance. Jean-Pierre B |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Analysis of measured test results by INTERVAL (variable) | Excel Discussion (Misc queries) | |||
Input cell reference is not valid (One Variable Data Table) | Excel Worksheet Functions | |||
test for not blank, use value in cell and set as variable | Excel Discussion (Misc queries) | |||
How to test if a repertory is valid | Excel Programming | |||
Test that a workbook is open | Excel Programming |