ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Excel bogs down when running my macros, what is causing it? (https://www.excelbanter.com/excel-discussion-misc-queries/135483-excel-bogs-down-when-running-my-macros-what-causing.html)

Rakmup

Excel bogs down when running my macros, what is causing it?
 
It doesn't happen in all workbooks. I have nearly identical workbooks and
some are slow to respond and process the macros, while others fly through in
a couple of seconds. I thought it was size related when I 1st encountered
the problem, but since I have had the problem on smaller workbooks. Setting
the calculation to manual seems to help, but does not eliminate the problem.
Looking for suggestions

Gary Brown

Excel bogs down when running my macros, what is causing it?
 
Location???
Fast server vs. Slow server???
--
HTH,
Gary Brown

If this post was helpful to you, please select ''YES'' at the bottom of the
post.



"Rakmup" wrote:

It doesn't happen in all workbooks. I have nearly identical workbooks and
some are slow to respond and process the macros, while others fly through in
a couple of seconds. I thought it was size related when I 1st encountered
the problem, but since I have had the problem on smaller workbooks. Setting
the calculation to manual seems to help, but does not eliminate the problem.
Looking for suggestions


Dave Peterson

Excel bogs down when running my macros, what is causing it?
 
I would think that it would depend a lot on what your macro does--if it
inserts/deletes rows or columns, then...

(Saved from a previous post)

Do you see the dotted lines that you get after you do a print or print preview?

If you do
Tools|Options|view tab|uncheck display page breaks

does the run time go back to normal?

Since you're changing columnwidths, excel could be figuring out where those
dotted lines go.

You may want to do something like:

Option Explicit
Sub testme()

Dim CalcMode As Long
Dim ViewMode As Long

Application.ScreenUpdating = False

CalcMode = Application.Calculation
Application.Calculation = xlCalculationManual

ViewMode = ActiveWindow.View
ActiveWindow.View = xlNormalView

ActiveSheet.DisplayPageBreaks = False

'do the work

'put things back to what they were
Application.Calculation = CalcMode
ActiveWindow.View = ViewMode

End Sub

Being in View|PageBreak Preview mode can slow macros down, too.


Rakmup wrote:

It doesn't happen in all workbooks. I have nearly identical workbooks and
some are slow to respond and process the macros, while others fly through in
a couple of seconds. I thought it was size related when I 1st encountered
the problem, but since I have had the problem on smaller workbooks. Setting
the calculation to manual seems to help, but does not eliminate the problem.
Looking for suggestions


--

Dave Peterson


All times are GMT +1. The time now is 07:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com