Darkcloud617
New Member
- Joined
- Sep 7, 2017
- Messages
- 38
Hello,
I found a code online that is very useful for one of my purposes but it is throwing a Mismatch error when I am attempting to use it. The code is placed in 'ThisWorkbook' to start calculating the time someone is in a workbook- to eventually kick them out automatically (with a different code in the Module).
and this line is throwing the Mismatch error
I am at a loss as I have tried to correct the "" (I thought the quotes may be causing it) and attempted to rework it a bit but was not successful. To give a broad view, this code starts counting when a workbook is opened, counts down 58 minutes, if workbook still opened at 58 minutes then close the workbook without saving. I believe the code above is just starting the timer and referring back to check in 10 minutes if its still opened. Any help you can provide will be very helpful.
I found a code online that is very useful for one of my purposes but it is throwing a Mismatch error when I am attempting to use it. The code is placed in 'ThisWorkbook' to start calculating the time someone is in a workbook- to eventually kick them out automatically (with a different code in the Module).
Code:
Private Sub Workbook_Open()
'Set StartTime when the workbook is opened.
StartTime = Timer
'Schedule a call to CheckTime in the future to check elapsed idle time.
Application.OnTime (Now + TimeValue(TimeCheckDelay)), "CheckTime"
End Sub
and this line is throwing the Mismatch error
Code:
Application.OnTime (Now + TimeValue(TimeCheckDelay)), "CheckTime"
I am at a loss as I have tried to correct the "" (I thought the quotes may be causing it) and attempted to rework it a bit but was not successful. To give a broad view, this code starts counting when a workbook is opened, counts down 58 minutes, if workbook still opened at 58 minutes then close the workbook without saving. I believe the code above is just starting the timer and referring back to check in 10 minutes if its still opened. Any help you can provide will be very helpful.