Check an object reference

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Using Office 2003 and Windows XP;

I have an object reference to a file, call it "goFile".

I need to be able to do two things with this reference:

1. Determine if the file it is refering to is open.

2. Determine if the reference is set to anything.

Could someone please post example code that illustrates these two things?

Thanks much in advance.
 
if gofile is not nothing then
For Each wbk In Workbooks
if wbk.name = gofile then
' Enter code here
end if
next wbk
end if
 
Hello,

Sorry to butt in but I think the actual syntax should be:

If Not gofile Is Nothing


HTH,
JP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top