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: 1
Default Set Excel margins from MS Project

I'm writing a macro from MS Project that changes Excel PageSetup prior
to exporting data to it. All of my PageSetup commands are working
except the ones to change margins. Can anyone tell me why, please?

'Set up Excel page header and footer, orientation, margins, and titles
With xlBook.Worksheets(1).PageSetup
.LeftMargin = Application.InchesToPoints(0.5)
.RightMargin = Application.InchesToPoints(0.5)
.TopMargin = Application.InchesToPoints(0.5)
.BottomMargin = Application.InchesToPoints(0.5)
.HeaderMargin = Application.InchesToPoints(0.25)
.FooterMargin = Application.InchesToPoints(0.25)
.RightFooter = "&""Arial,Italic""xls1.Name"
.CenterFooter = "&""Arial,Italic""&8Page &P of &N"
.RightFooter = "&""Arial,Italic""&8&D &T"
.Orientation = xlLandscape
.PaperSize = xlPaperLegal
.CenterHorizontally = True
.PrintTitleRows = "$1:$5"
.PrintTitleColumns = "A$:E$"
End With

Thanks,
Caroline
 
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
Are margins in Excel variable? AS Excel Discussion (Misc queries) 2 January 22nd 09 05:16 PM
excel margins Nel Excel Worksheet Functions 0 December 5th 08 09:02 PM
Excell error "Can't find Project or Library" Project VBAProject Lost in Excel Excel Worksheet Functions 0 April 12th 07 04:42 PM
How to convert MS Project to MS Excel. I don't have MS Project. Jane Excel Discussion (Misc queries) 1 February 20th 06 10:01 PM
Problems with Margins in Excel CCW Excel Discussion (Misc queries) 0 January 21st 05 05:11 PM


All times are GMT +1. The time now is 06:51 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"