VBNewbiwe83
New Member
- Joined
- Aug 29, 2018
- Messages
- 11
Hi,
I have an xlsm document that that is accessed via sharepoint by around 300 people at the same time. It has some simple vlookups, if statement's and vb code.
They use office 10 and 16 and I have checked the compatibility of the document.
There is not a specific action causing the problem, so I am wondering f it this below piece of code that causes excel to stop responding and restart:
Thank
I have an xlsm document that that is accessed via sharepoint by around 300 people at the same time. It has some simple vlookups, if statement's and vb code.
They use office 10 and 16 and I have checked the compatibility of the document.
There is not a specific action causing the problem, so I am wondering f it this below piece of code that causes excel to stop responding and restart:
Code:
Private Sub Worksheet_Calculate()
Dim sAddress As String
On Error GoTo errHandle
ActiveSheet.Unprotect "Experience"
sAddress = "A19, A21, A25, A28, A34, A36, A38, A44, A47, A49, A55, A58, A60, A62, A64, A70, A77, A82, A85, A93"
'disable change events
Application.EnableEvents = False
Range(sAddress).EntireRow.AutoFit
're-enable events
Application.EnableEvents = True
ActiveSheet.Protect "Experience", True, True
errHandle:
'if there is an error ensure to re-enable events
Application.EnableEvents = True
End Sub
Thank