LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default PageSetup changes not working in VBA

I am trying to change the PageSetup using VBA, but it does not seem to
take the changes. I tried using both the XL4M method and the
standard .PageSetup. I seem to be able to set the print area, but not
the PaperSize or the Orientation. I have stepped through the code and
it does not error out, but the settings do not change in PageSetup
either. The worksheet is not protected.

Here are the two methods that I used (I put the code for PageSetupXL4M
into its own macro).

With Worksheets("Master Index").PageSetup
'With ActiveSheet.PageSetup
'.PrintHeadings = False
.Zoom = False
.Orientation = page_orientation
.CenterHorizontally = False
.CenterVertically = False
.PaperSize = page_size
.FitToPagesWide = 1
.PrintErrors = xlPrintErrorsDisplayed
End With

PageSetupXL4M PrintHeadings:=False, _
Zoom:=False, _
Orientation:=page_orientation, _
CenterHorizontally:=False, _
CenterVertically:=False, _
PaperSize:=page_size

I have tried setting page_orientation to both the string "xlPortrait"
and the number xlPortrait (1).


Thanks for your help,
David

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
PageSetup Macro Julian Glass Excel Worksheet Functions 1 March 29th 08 01:54 PM
PageSetup Stanley Excel Discussion (Misc queries) 1 December 14th 05 07:21 PM
PageSetup Simon Shaw Excel Programming 3 May 28th 05 01:28 PM
Working with headers in pagesetup OkieViking Excel Programming 2 April 16th 05 11:47 PM
PageSetup Simon Shaw[_4_] Excel Programming 1 May 28th 04 08:41 AM


All times are GMT +1. The time now is 03:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"