1

I need to check whether a file(test.xls) is open or not. If it is already open then show a msgbox "Open" else show a message box "Open the file" How can I do that?

  On Error GoTo nofile
    Windows("So Deit.xls").Activate
    MsgBox "File Open"

nofile:
    Workbooks.Open fileName:="C:\Users\ds\Desktop\New folder\So Deit.xls"
End Sub
Tom Brunberg
  • 20,312
  • 8
  • 37
  • 54
Maneesh
  • 11
  • 1
  • Please format better. Separate the title from the contents. – Lore Nov 30 '19 at 12:09
  • 2
    Does this answer your question? [Detect whether Excel workbook is already open](https://stackoverflow.com/questions/9373082/detect-whether-excel-workbook-is-already-open) – manoj0790 Nov 30 '19 at 13:12

0 Answers0