View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default sub slow down after page prview

Then I would think something like this code:
ActiveSheet.DisplayPageBreaks = False
would help in code.

Maybe inserting the hyperlink changes the style (and the font size) and that
could be the same as changing the rowheight????

mcg wrote:

i unchecked pagebreaks in tools-options anh it helped
thanks
mcg

Dave Peterson napisal(a):
You may have noticed little dotted lines indicating page breaks after you do
File|Print (or print preview).

If your macro inserts/deletes rows or columns (or even changes heights/widths)
lots of times, then excel tries to figure out what to do with those dotted
lines. And that can slow your code down.

I do something like this to avoid the problem:

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



mcg wrote:

hi,
i have sub adding 180 hyperlinks
usually it takes app 2 sec to run it
but after page preview or switching to page breaks same sub runs for
nearly 30 secs

what could be causing that?
i do not have any sub in beforeprint event
mcg


--

Dave Peterson


--

Dave Peterson