I have a file where users add data to a file but I don’t want them to be able to work in it. I have a form feed this file. I would like to test to see if a file is currently in use. If it is let the user know to try later. However, since they shouldn’t open the file to work in it I don’t want them to be notified when it’s available. This is what I have but it always says the file is in use. Your help would be greatly appreciated.
'Check to see if the Data file is open
a = Range("Main!A63").Value
If Workbooks(a).ReadOnly = True Then
MsgBox ("Currently being updated. Please try later.")
Exit Sub
End If
'Check to see if the Data file is open
a = Range("Main!A63").Value
If Workbooks(a).ReadOnly = True Then
MsgBox ("Currently being updated. Please try later.")
Exit Sub
End If