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

Statistiques des forums

Discussions
312 224
Messages
2 086 409
Membres
103 201
dernier inscrit
centrale vet