When I close the user form, it’s supposed to save the file the inputted information is in. I keep getting errors about “Someone else is working in”. I wrote the following code to try and handle the error, but I Don’t know if this is the right way to handle to error or if it’s actually working? It seems like it is, but I have also gotten the error with this code in place.
I have the following code in place.
Public Sub SaveEmployeeData()
'save the Employee Data
On Error GoTo ErrHandler
Workbooks("Employee_List.xlsx").Save
ErrHandler:
If InStr(Err.Description, "Someone else is working in") > 0 Then
Err.Clear
Workbooks("Employee_List.xlsx").Save
End If
End Sub
If I wrote it correctly it supposed to clear the error and try saving again.