Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 325
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 325
Default 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
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
Analysis of measured test results by INTERVAL (variable) Tom Excel Discussion (Misc queries) 2 February 11th 09 12:50 AM
Input cell reference is not valid (One Variable Data Table) Dottore Excel Worksheet Functions 9 September 1st 05 03:05 PM
test for not blank, use value in cell and set as variable Robert Excel Discussion (Misc queries) 0 March 24th 05 11:25 PM
How to test if a repertory is valid Alex St-Pierre Excel Programming 2 February 17th 05 02:30 AM
Test that a workbook is open Gef[_2_] Excel Programming 2 April 6th 04 11:17 AM


All times are GMT +1. The time now is 10:35 PM.

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

About Us

"It's about Microsoft Excel"