Workbook is read only try again

  • I have this code that checks to make sure the workbook is not open/in use.

    How would I modify it to try again in 5 seconds and after 3 tries then send the MsgBox?

     If wBook.ReadOnly = True Then        MsgBox "Database is in use. Please try after sometimes.", vbookonly + vbCritical, "error"           
         Exit Sub   
     End If
  • Possibly...

    If I've been helpful, let me know. If I haven't, let me know that too. 

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!