Computing.Net > Forums > Office Software > Excel Macro ActiveSheet.PageSetup

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Excel Macro ActiveSheet.PageSetup

Reply to Message Icon

Name: Erik48
Date: May 25, 2005 at 07:38:38 Pacific
OS: Windows 5.0
CPU/Ram: 1500 Mhz 655 Meg Ram
Comment:

I am having a problem with a macro executing the ActiveSheet.PageSetup function. It works when used in a macro triggered within Excel. However, I am using a call routine from DataEase to run a macro and everything works except the ActiveSheet.PageSetup. The objective is to set the margins, go to landscape and have some rows repeat at the top of each page. The following is the start of the macro:
Private Sub Workbook_Open()
....
With ActiveSheet.PageSetup
.PrintTitleRows = "$1:$5"
.PrintTitleColumns = ""
End With
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = "Page &P of &N"
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.25)
.RightMargin = Application.InchesToPoints(0.25)
.TopMargin = Application.InchesToPoints(0.75)

Etc.

All the other formating/calculations in the macro works.



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Office Software Forum Home


Sponsored links

Ads by Google


Results for: Excel Macro ActiveSheet.PageSetup

Run Excel Macro as Automated Task on Server www.computing.net/answers/office/run-excel-macro-as-automated-task-on-server/9661.html

Excel Macro read and process CSV www.computing.net/answers/office/excel-macro-read-and-process-csv/3820.html

Excel macro www.computing.net/answers/office/excel-macro/4051.html