mise en page dans macro et impression

Boostez vos compétences Excel avec notre communauté !

Rejoignez Excel Downloads, le rendez-vous des passionnés où l'entraide fait la force. Apprenez, échangez, progressez – et tout ça gratuitement ! 👉 Inscrivez-vous maintenant !

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
 
- Navigue sans publicité
- Accède à Cléa, notre assistante IA experte Excel... et pas que...
- Profite de fonctionnalités exclusives
Ton soutien permet à Excel Downloads de rester 100% gratuit et de continuer à rassembler les passionnés d'Excel.
Je deviens Supporter XLD

Discussions similaires

Réponses
7
Affichages
116
Retour