View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Vasant Nanavati Vasant Nanavati is offline
external usenet poster
 
Posts: 1,080
Default Check file open status

On Error Resume Next
Set wb = Workbooks("MyWorkbook.xls")
On Error GoTo 0
If wb Is Nothing Then
'open it
Else
'already open
End If

--

Vasant



"kaon " wrote in message
...
Hi all,

I have written a macro to do cell copying from a xls to another xls, in
the marco I used .getopenfilename to open a file, but I do not want to
open the file again if it is already opened. So how can I check the
file open status?

Thanks.


---
Message posted from http://www.ExcelForum.com/