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

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

Forum statistics

Threads
1,216,036
Messages
6,128,432
Members
449,452
Latest member
Chris87

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