xlsm crashing

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:
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 :-)
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top