Bug mise en page

Résolu/Fermé
pascalou83400 Messages postés 273 Date d'inscription dimanche 20 juillet 2014 Statut Membre Dernière intervention 24 janvier 2022 - 4 août 2014 à 10:35
pascalou83400 Messages postés 273 Date d'inscription dimanche 20 juillet 2014 Statut Membre Dernière intervention 24 janvier 2022 - 4 août 2014 à 13:45
Bonjour,


J'ai bug sur une ligne de code et je ne trouve pas le pb, ce code est dans une boucle avec plusieurs feuilles.

Merci pour votre aide.


'4F) mise en page automatique

ActiveWorkbook.Worksheets(I).Application.PrintCommunication = False


c'est celui la qui ce met en jaune.

With ActiveWorkbook.Worksheets(I).ActiveSheet.PageSetup




ActiveWorkbook.Worksheets(I).PrintTitleRows = "$16:$16"
ActiveWorkbook.Worksheets(I).PrintTitleColumns = ""
End With
ActiveWorkbook.Worksheets(I).Application.PrintCommunication = True
ActiveWorkbook.Worksheets(I).ActiveSheet.PageSetup.PrintArea = ""
ActiveWorkbook.Worksheets(I).Application.PrintCommunication = False
With ActiveWorkbook.Worksheets(I).ActiveSheet.PageSetup

' droite en tete
ActiveWorkbook.Worksheets(I).LeftHeader = ""

' centré verticale en tete
ActiveWorkbook.Worksheets(I).CenterHeader = "&28&A"

' gauche en tete
ActiveWorkbook.Worksheets(I).RightHeader = ""

' droite en pied
ActiveWorkbook.Worksheets(I).LeftFooter = ""

' centré horizontal pied
ActiveWorkbook.Worksheets(I).CenterFooter = "&28Page &P de &N"

' gauche pied
ActiveWorkbook.Worksheets(I).RightFooter = "&28&D"

' marge droite
ActiveWorkbook.Worksheets(I).LeftMargin = Application.InchesToPoints(0.118110236220472)
' marge gauche
ActiveWorkbook.Worksheets(I).RightMargin = Application.InchesToPoints(0.118110236220472)
' ' marge haute
ActiveWorkbook.Worksheets(I).TopMargin = Application.InchesToPoints(0.551181102362205)
' marge basse
ActiveWorkbook.Worksheets(I).BottomMargin = Application.InchesToPoints(0.354330708661417)
' marge en tete de page
ActiveWorkbook.Worksheets(I).HeaderMargin = Application.InchesToPoints(0.31496062992126)
' marge pied de page
ActiveWorkbook.Worksheets(I).FooterMargin = Application.InchesToPoints(0.118110236220472)

ActiveWorkbook.Worksheets(I).PrintHeadings = False
ActiveWorkbook.Worksheets(I).PrintGridlines = False
ActiveWorkbook.Worksheets(I).PrintComments = xlPrintNoComments
ActiveWorkbook.Worksheets(I).CenterHorizontally = True
ActiveWorkbook.Worksheets(I).CenterVertically = True

' format paysage
ActiveWorkbook.Worksheets(I).Orientation = xlLandscape
ActiveWorkbook.Worksheets(I).Draft = False
ActiveWorkbook.Worksheets(I).PaperSize = xlPaperA4
ActiveWorkbook.Worksheets(I).FirstPageNumber = xlAutomatic
ActiveWorkbook.Worksheets(I).Order = xlDownThenOver
ActiveWorkbook.Worksheets(I).BlackAndWhite = False
ActiveWorkbook.Worksheets(I).Zoom = False
ActiveWorkbook.Worksheets(I).FitToPagesWide = 1
ActiveWorkbook.Worksheets(I).FitToPagesTall = False
ActiveWorkbook.Worksheets(I).PrintErrors = xlPrintErrorsDisplayed
ActiveWorkbook.Worksheets(I).OddAndEvenPagesHeaderFooter = False
ActiveWorkbook.Worksheets(I).DifferentFirstPageHeaderFooter = False
ActiveWorkbook.Worksheets(I).ScaleWithDocHeaderFooter = True
ActiveWorkbook.Worksheets(I).AlignMarginsHeaderFooter = True
ActiveWorkbook.Worksheets(I).EvenPage.LeftHeader.Text = ""
ActiveWorkbook.Worksheets(I).EvenPage.CenterHeader.Text = ""
ActiveWorkbook.Worksheets(I).EvenPage.RightHeader.Text = ""
ActiveWorkbook.Worksheets(I).EvenPage.LeftFooter.Text = ""
ActiveWorkbook.Worksheets(I).EvenPage.CenterFooter.Text = ""
ActiveWorkbook.Worksheets(I).EvenPage.RightFooter.Text = ""
ActiveWorkbook.Worksheets(I).FirstPage.LeftHeader.Text = ""
ActiveWorkbook.Worksheets(I).FirstPage.CenterHeader.Text = ""
ActiveWorkbook.Worksheets(I).FirstPage.RightHeader.Text = ""
ActiveWorkbook.Worksheets(I).FirstPage.LeftFooter.Text = ""
ActiveWorkbook.Worksheets(I).FirstPage.CenterFooter.Text = ""
ActiveWorkbook.Worksheets(I).FirstPage.RightFooter.Text = ""
End With
ActiveWorkbook.Worksheets(I).Application.PrintCommunication = True


A voir également:

3 réponses

WeaponEDGE Messages postés 113 Date d'inscription vendredi 18 juillet 2014 Statut Membre Dernière intervention 21 novembre 2014 9
4 août 2014 à 11:17
Bonjour,

Dans le VisualBasic Editor, ouvre la fenêtre "Fenêtre Variable Local" dans le menu View et essayes de faire fonctionner ta macro Pas à Pas avec la touche F8.

Cette fenêtre te permettra éventuellement de déceller une anomalie au niveau du contenu d'une variable

Si ce code est une boucle avec plusieurs Feuilles, assures que toutes les feuilles mentionné dans le code existent encore sur le fichier Excel.
0
pascalou83400 Messages postés 273 Date d'inscription dimanche 20 juillet 2014 Statut Membre Dernière intervention 24 janvier 2022
4 août 2014 à 13:29
Bonjour WeaponADGE,

Merci je vais essayer ton procédé.

A+

Pascal
0
pascalou83400 Messages postés 273 Date d'inscription dimanche 20 juillet 2014 Statut Membre Dernière intervention 24 janvier 2022
4 août 2014 à 13:45
bon j'ai trouvé la fenêtre , mais comme je ne connais pas les infos qui sont mentionnées, je ne peux pas me dépanner avec ça.

Je continue à chercher.

Merci

A+

Pascal
0