LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default check if a file is open

nice one

thanks


"Patricia Shannon" wrote in
message ...
There probably aren't enough files to check to worry about it, but it
would
be a little more efficient to add the "Exit For" as I've indicated in the
code below.

"C" wrote:

thanks for before

i know this isnt as complex with the checking who has it open but i have
come up with this


Dim chkfile
chkfile = 0
Update.Hide
For Each ws In Worksheets
If ws.Name = "revenue schedules 2006.xls" Then
chkfile = 1

== exit for
End If
Next ws

If chkfile = 1 Then
'do code
Else
MsgBox "the Rev Schedules is not open. please open the file and try
again"

End If


C

"C" wrote in message
...
also i dont always have the path name of the file

it moves but the file name is always the same

can i check to see if a window is open




"C" wrote in message
...
Hi

bit of a beginner in excel VBA but i am trying to find out if can
check
to see if a file is open

as in

IF 'file a is open' THEN
Code
code
code
ELSE
msg "file a is not open please try again"
END IF

is this possible and does anyone have any code for this

Thanks
C








 
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
How to check for Open File! Ayo Excel Discussion (Misc queries) 2 August 11th 08 06:55 PM
check if file is already open mohavv Excel Discussion (Misc queries) 1 October 15th 07 12:08 AM
File Open Check dthmtlgod Excel Programming 1 January 13th 06 02:51 PM
check if file already is open Mats Nilsson Excel Programming 2 September 12th 05 09:30 AM
How to check Excel file already Open Rudy S Excel Programming 2 January 25th 05 02:00 PM


All times are GMT +1. The time now is 09:15 AM.

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

About Us

"It's about Microsoft Excel"