View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Hari Hari is offline
external usenet poster
 
Posts: 46
Default Does the object already have a value set?

Hi,

I have an workbook object named "RespWkbook"

I would like to check whether I have already assigned a workbook to it.
If so then I would like to close the assign that workbook (because it
has become old for me) and set a new workbook to RespWkBook.

I tried

if Not(IsNull(RespWkbook)) then RespWkbook.close
set RspWbook = "//hari/desktop/NewWrkBook.xls"

But it didnt work

I also tried

if Not(Isempty(RespWkbook)) then RespWkbook.close
set Respwkbook = "//hari/desktop/NewworkBook.xls"

again it is not working.

Whats the right syntax for checking whether an object has value Nothing
or not and be able to do the operation I want to do?

Rgards,
Hari
India