Précédent   Forum des professionnels en informatique > Logiciels > Microsoft Office > Excel > Macros et VBA Excel
Macros et VBA Excel Vos questions relatives aux macros Excel, à l'utilisation de VBA et à l'automatisation de vos classeurs Excel.
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 13/11/2011, 18h20   #1
Invité de passage
 
Inscription : septembre 2008
Messages : 121
Détails du profil
Informations forums :
Inscription : septembre 2008
Messages : 121
Points : 4
Points : 4
Par défaut Code très lent

Bonjour

J'ai un code pour imprimer qui est long je pense qu'il y a un problème si quelqu'un pourrez me dire ou est le beug ?


Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Private Sub CommandButton1_Click()
' Bouton Sélection Imprimante
Application.Dialogs(xlDialogPrinterSetup).Show
' Apercu avant imprime
Worksheets("Feuil2").PrintPreview
 
With Sheets("Feuil2")
    With .PageSetup
        .Orientation = xlLandscape  'paysage
        .CenterHorizontally = True  'centré horizontalement
        .CenterVertically = True    'centré verticalement
        .LeftMargin = Application.InchesToPoints(0)   'marge gauche
        .RightMargin = Application.InchesToPoints(0)  'marge droite
        .TopMargin = Application.InchesToPoints(0)    'marge haut
        .BottomMargin = Application.InchesToPoints(0) 'marge bas
        .Zoom = False 'pas de zom
 
        .FitToPagesTall = 1 '1 page en hauteur
        .FitToPagesWide = 1 '1 page en largeur
    End With
'imprime
 ActiveSheet.PrintOut
End With
End Sub
Un très grand merci pour celui ou celle qui pourra m'aider……..
Cordialement
Max
apdf1 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 13/11/2011, 18h36   #2
Expert Confirmé
 
Homme Philippe
ex Observeur CGG / Analyste prog.
Inscription : juin 2006
Messages : 1 708
Détails du profil
Informations personnelles :
Nom : Homme Philippe
Localisation : France, Finistère (Bretagne)

Informations professionnelles :
Activité : ex Observeur CGG / Analyste prog.

Informations forums :
Inscription : juin 2006
Messages : 1 708
Points : 3 633
Points : 3 633
Salut, un grand classique, voir http://www.developpez.net/forums/d55...ge-macros-xl4/
La version 2010 aurait apporté une solution via :

Code :
1
2
3
Application.PrintCommunication = False
 ' .....
Application.PrintCommunication = True
__________________
Pensez à Voter, d'avance merci. ( Pouces en bas à la droite de Citer )
Balisez votre code après l'avoir indenté sous Excel via Smart Indenter
Autre utilitaire : MZ Tools 3.0 VBA

Contribution : Excel / Word / PDF avec Adobe Acrobat Pro / PDFCreator 1 2
kiki29 est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 09h27.


 
 
 
 
Partenaires

Hébergement Web