Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default Check an object reference

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Check an object reference

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

"XP" wrote:

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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 168
Default Check an object reference

Hello,

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

If Not gofile Is Nothing


HTH,
JP


On Oct 19, 5:50 pm, Joel wrote:
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



"XP" wrote:
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.- Hide quoted text -


- Show quoted text -



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
check if name object exists mark kubicki Excel Programming 1 January 18th 07 10:40 PM
How to, check if a picture object exist Kevin McCartney Excel Programming 7 May 24th 06 08:53 PM
How to check if an object has a certain property? J Excel Programming 1 December 5th 04 11:58 AM
Check for any data changes in a form with multipage object Bert Neuenschwander Excel Programming 2 September 24th 04 06:31 AM


All times are GMT +1. The time now is 01:16 AM.

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"