View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Yong Peng Yong Peng is offline
external usenet poster
 
Posts: 1
Default execl to check if another excel file is open...

Hi Jim,
If the file is open in another instance,your code won't work.
Can you tell me how to deal with it?
Thanks
Yong

"Jim Thomlinson" wrote:

This code should be close...

Dim wbk As Workbook

On Error Resume Next
Set wbk = Workbooks("MyBook.xls")
On Error GoTo 0

If wbk Is Nothing Then MsgBox "Can't find it"

HTH

"ohboy!" wrote:

I need my one excel workbook to check if another one is open before it
copies across to it and if it is open to exit the copy sub and display
please try again later....can any help?



TIA