I have a shared macro-enabled workbook used to conduct quiz. I have the option to configure users that can access the quiz with the help of computer names. Everything is working fine. However, I would like to introduce a feature to log major things done in the workbook. User does not enter anything manually into cells. All entries are made using userforms.
I have made a sub, which runs every time user performs an operation that I need to capture. The code works like a charm when a single user is active. The problem occurs when multiple users are accessing the file at the same time.
The problem is, user is shown a prompt to choose which change to win on closing the sheet. I don’t want this to happen. Is there anyway by which the prompt can be removed and make all changes saved.
Is there any workaround for this. Below is the code that I have now.
Sub Actions()
QA_Quiz_Master.Save
Application.ScreenUpdating = False
UN = Evaluate("=UserNameWindows()")
QuizN = Sheet4.Range("F2").Value
totlog = Log.Range("A1048576").End(xlUp).Row + 1
Select Case Action
Case "Open"
Log.Range("C" & totlog).Value = "Accessed"
Case "Start"
Log.Range("C" & totlog).Value = "Started Quiz"
Case "Submit"
Log.Range("C" & totlog).Value = "Submitted Quiz"
Case "AdminContact"
Log.Range("C" & totlog).Value = "Contacted Admin"
Case "AccessRequest"
Log.Range("C" & totlog).Value = "Sent Access Request"
Case "Publish"
Log.Range("C" & totlog).Value = "Published Quiz"
Case "Republish"
Log.Range("C" & totlog).Value = "Republished Quiz"
Case "Withdraw"
Log.Range("C" & totlog).Value = "Withdrew Quiz"
Case "AnsPublish"
Log.Range("C" & totlog).Value = "Published Answers"
End Select
Log.Range("A" & totlog).Value = UN
Log.Range("B" & totlog).Value = QuizN
Log.Range("D" & totlog).Value = Now()
Log.Columns("A:D").EntireColumn.AutoFit
Application.DisplayAlerts = False
QA_Quiz_Master.Save
Application.ScreenUpdating = True
End Sub
After some research, I myself got the problem solved. I just needed to add the following code at the beginning of the sub