Ceci est une page optimisée pour les mobiles. Cliquez sur ce texte pour afficher la vraie page.

mise en page dans macro et impression

bertgrav

XLDnaute Occasionnel
bonjour.

J'ai fait une macro puis à un moment je fais la mise en page avant impression:

With ActiveSheet.PageSetup
.LeftHeader = ''
.CenterHeader = '&''Century,Gras''&20LES HABITANTS AU &D'
.RightHeader = '&''Century,Normal''&14&P'
.LeftFooter = ''
.CenterFooter = ''
.RightFooter = ''
.LeftMargin = Application.InchesToPoints(0.20)
.RightMargin = Application.InchesToPoints(0.20)
.TopMargin = Application.InchesToPoints(0.20)
.BottomMargin = Application.InchesToPoints(0.20)
.HeaderMargin = Application.InchesToPoints(0.80)
.FooterMargin = Application.InchesToPoints(0.50)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = True
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100


Elle fonctionne trés bien pour 1 type d'imprimante (exemple BROTHER) mais dés que je me reporte par défaut sur une autre ça plante.

donc j'ai changé par ça:

With ActiveSheet.PageSetup
.LeftHeader = ''
.CenterHeader = '&''Century,Gras''&20LES HABITANTS AU &D'
.RightHeader = '&''Century,Normal''&14&P'
.LeftFooter = ''
.CenterFooter = ''
.RightFooter = ''
.LeftMargin = Application.InchesToPoints(0.20)
.RightMargin = Application.InchesToPoints(0.20)
.TopMargin = Application.InchesToPoints(0.20)
.BottomMargin = Application.InchesToPoints(0.20)
.HeaderMargin = Application.InchesToPoints(0.80)
.FooterMargin = Application.InchesToPoints(0.50)
.Orientation = xlLandscape
.CenterHorizontally = True

ça marche

pouvez vous me dire si elle devrait marcher pour tous les types d'imprimante (je n'ai plus spécifié la qualité papier etc..par contre j'ai laissé l'orientation paysage et le centrage Horizontal.)

merci de vos remarques
 

Discussions similaires

Les cookies sont requis pour utiliser ce site. Vous devez les accepter pour continuer à utiliser le site. En savoir plus…