Code runs slow in the new excel (Office 365)

trimmjens

New Member
Joined
Oct 26, 2012
Messages
44
My company just converted to the new office 365.
I noticed that some of the VBA codes in my workbooks are executing very slow compared to the previous version :mad:

I'm wondering why this is and is it a way around it?
Are there new features in the new version that may affect VBA code execution?

Appreciate all replies :)
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
is your file hosted locally on your machine with references or off in the cloud somewhere
 
Upvote 0
Thanks for the reply , mole999 :)

The file is located on the company server that everyone uses, but I have also copies of the
file on my personal user. Nothing has changed other than the MS Office version.
 
Upvote 0
Try turning off your animation (if not already done) and see if it makes a difference.
File>Options>Advanced>Display, Then check "Disable Hardware Graphics Acceleration"

If this isn't the issue does your code use protection or save?
 
Upvote 0
I did what you suggested, MARK858, but it's still the same.

The code actually use protecting/unprotecting. Does this take longer in the new version?
 
Upvote 0
I did what you suggested, MARK858, but it's still the same.

The code actually use protecting/unprotecting. Does this take longer in the new version?

Did at one time and don't know if it ever got resolved as I don't run 365/2013 at home to test.
Please see the link below which discusses the matter and offers a few workarounds on page 2.

Macro(VBA) works too much slowly in excel 2013
 
Upvote 0
Did at one time and don't know if it ever got resolved as I don't run 365/2013 at home to test.
Please see the link below which discusses the matter and offers a few workarounds on page 2.

Macro(VBA) works too much slowly in excel 2013

It seems for me that I have to deal with the slower code execution. Guess it has to do with the new algorithm for password protection.

It's not the end of the world for me anyway. The code takes about 3,6 sec compared to 0,something before the change.

Thank you anyway for your help! :)
 
Upvote 0
maybe some of the subs could be improved ?
 
Upvote 0
Guess it has to do with the new algorithm for password protection.

Why would you need to guess? If you comment out the protection in the code and run it you will soon see if it is the protection causing the issue :confused:

maybe some of the subs could be improved ?

As mole999 states, why not post your code in case someone can see something that can be improved?
 
Upvote 0
Why would you need to guess? If you comment out the protection in the code and run it you will soon see if it is the protection causing the issue :confused:



As mole999 states, why not post your code in case someone can see something that can be improved?

I know it is the protection that causes the delay because i put the "Debug.Print Timer - Start" in font and behind the protection section.

Not a stupid idea mole999. Maybe someone sees something that I don't. Here is my code:

Code:
Private Sub CommandButton2_Click()
'Beskytt

Start = Timer

If Sheets("Well Data").ProtectContents = True Then Exit sub

With Application
    .Cursor = xlWait
    .EnableCancelKey = xlDisabled
End With
    
    On Error Resume Next
    Alternativer.Caption = ("Alternativer " + Sheets("Well Data").Range("H4").Value + " - beskyttet")
    Sheets("Well Data").Range("B3") = "BESKYTTET"
    Alternativer.Label17.Visible = False

    Application.ScreenUpdating = False

    ActiveWorkbook.Protect Structure:=True, Windows:=False, Password:="blabla..."
    
    Dim ws As Worksheet
    For Each ws In Worksheets
    ws.Protect "blabla..."
    Next
    
'Avbryt
    Me.CommandButton9.Visible = False
    Me.CommandButton11.Visible = False
    Me.CommandButton5.Enabled = True
    
    Me.TextBox1.Value = ""
    Me.TextBox2.Value = ""
    Me.TextBox3.Value = ""
    With Me.TextBox4
        .Locked = True
        .BackStyle = fmBackStyleTransparent
        .Text = Sheets("Hidden").Range("L1")
        .SelStart = 0
    End With
    
    Application.Cursor = xlDefault
    
    Debug.Print Timer - Start

End Sub
 
Upvote 0

Forum statistics

Threads
1,216,118
Messages
6,128,939
Members
449,480
Latest member
yesitisasport

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