Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wipe out all Excel print setup data?

Status
Not open for further replies.

johnnygeo

Programmer
Apr 23, 2003
125
US
I have a procedure which toggles a bunch of columns/rows between hidden and unhidden to make a "printable" extract. It runs fine. The problem is that once I try to edit the print setup, such as by defining the print range or using print preview mode, the procedure runs extremely slowly. I think what is happening is that Excel is recalculating page breaks with every column that is hidden or revealed. The only way to get it running fast again is to clear the print area using file|print area|clear print area, then saving/closing/reopening the file.

I have tried placing
ActiveSheet.PageSetup.PrintArea = ""
and
ActiveSheet.ResetAllPageBreaks
at the beginning and end of the procedure, but they don't seem to work.

Is there a way to force Excel to forget all about any print settings? Or is there an equivalent to ScreenUpdating=False to suppress pagination until the procedure is done?

Thanks,
Johnny Geo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top