Anzeige
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Inhaltsverzeichnis

Druckmakro - dauert lange

Forumthread: Druckmakro - dauert lange

Druckmakro - dauert lange
19.03.2009 11:00:29
lutz
Hallo Excel-Spezis,
ich habe ein Druckmakro welches so aussieht:

Sub Druckhoch()
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = "_____________________________________________________&8" & Chr(10) &  _
Benutzername
.CenterFooter = "_____________________________________________________&8" & Chr(10) & "Seite &P/ _
&N, Date &D; &T Uhr"
.RightFooter = "__________________________________________________&8" & Chr(10) & "&F/ &A"
.LeftMargin = Application.InchesToPoints(0.748031496062992)
.RightMargin = Application.InchesToPoints(0.196850393700787)
.TopMargin = Application.InchesToPoints(0.590551181102362)
.BottomMargin = Application.InchesToPoints(0.984251968503937)
.HeaderMargin = Application.InchesToPoints(0.118110236220472)
.FooterMargin = Application.InchesToPoints(0.118110236220472)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
End Sub


Funktioniert auch prima, es dauert nur jedesmal ca. 15 sekunden.
Auch Application.ScreenUpdating = False und True am Ende bringt nichts.
Wie kann man das Makro Beschleunigen?
Vielen Dank Gruß Lutz

Anzeige

5
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: schneller mit Excel4Makros - PAGE.SETUP
19.03.2009 13:57:47
lutz
Hallo Daniel,
vielen Dank.
Bin dabei das zu machen - ist aber wenig zu finden im Netz.
Bin soweit:
Sub test4()
ExecuteExcel4Macro "PAGE.SETUP(""________&8& chr(10)& Text& Seite &P/&N, Date &D; &T Uhr"",""TEST"",0.748031496062992,0.196850393700787,0.590551181102362,0.984251968503937,0.118110236220472,0.118110236220472,0,0,1,,100,#N/A,1,0,,0.2,0.3,0,0)"
End Sub


Kennt jemand sich damit aus? Ich weiß nicht wie ich meine Trennlinie da reinbekomme.
Die Syntax ist in Macrofun.hlp erklärt - hat jemand das in Deutsch?
Das hier habe ich auch gefunden - weiß nicht, ob man das wirklich nutzen kann:
>


Public Sub PageSetupXL4M( _
> Optional LeftHead As String, _
> Optional CenterHead As String, _
> Optional RightHead As String, _
> Optional LeftFoot As String, _
> Optional CenterFoot As String, _
> Optional RightFoot As String, _
> Optional LeftMarginInches As String, _
> Optional RightMarginInches As String, _
> Optional TopMarginInches As String, _
> Optional BottomMarginInches As String, _
> Optional HeaderMarginInches As String, _
> Optional FooterMarginInches As String, _
> Optional PrintHeadings As String, _
> Optional PrintGridlines As String, _
> Optional PrintComments As String, _
> Optional PrintQuality As String, _
> Optional CenterHorizontally As String, _
> Optional CenterVertically As String, _
> Optional Orientation As String, _
> Optional Draft As String, _
> Optional PaperSize As String, _
> Optional FirstPageNumber As String, _
> Optional Order As String, _
> Optional BlackAndWhite As String, _
> Optional Zoom As String)
> 'based on a post by John Green in
> 'microsoft.public.excel.programming
> 'on 21 January 2001:
> 'http://google.com/ _
groups?selm=VA.00000b2f.0028c7e5%40mara9"
> Const c As String = ","
> Dim pgSetup As String
> Dim head As String
> Dim foot As String
> If LeftHead  "" Then head = "&L" & LeftHead
> If CenterHead  "" Then head = head & "&C" & CenterHead
> If RightHead  "" Then head = head & "&R" & RightHead
> If Not head="" Then head = """" & head & """"
> If LeftFoot  "" Then foot = "&L" & LeftFoot
> If CenterFoot  "" Then foot = foot & "&C" & CenterFoot
> If RightFoot  "" Then foot = foot & "&R" & RightFoot
> If Not foot="" Then foot = """" & foot & """"
>
> pgSetup = "PAGE.SETUP(" & head & c & foot & c & _
> LeftMarginInches & c & RightMarginInches & c & _
> TopMarginInches & c & BottomMarginInches & c & _
> PrintHeadings & c & PrintGridlines & c & _
> CenterHorizontally & c & CenterVertically & c & _
> Orientation & c & PaperSize & c & Zoom & c & _
> FirstPageNumber & c & Order & c & BlackAndWhite & c & _
> PrintQuality & c & HeaderMarginInches & c & _
> FooterMarginInches & c & PrintComments & c & Draft & ")"
> Application.ExecuteExcel4Macro pgSetup
> End Sub


Gruß Lutz

Anzeige
AW: schneller mit Excel4Makros - PAGE.SETUP
19.03.2009 18:08:29
Horst
Hi,
was sind schon 15 Sekunden, wenn man bedenkt, dass die Züchtung des Bitburger
Siegelhopfens 20 Jahre gedauert hat.
mfg Horst
AW: schneller mit Excel4Makros - PAGE.SETUP
19.03.2009 18:15:23
Lutz
Hallo Horst,
vielen Dank für Deinen sehr hilfreichen Beitrag. Ich überlege mir das mal bei einem Pils.
Leider hilft es mir nicht wirklich weiter - daher besser noch offen.
Gruß
Lutz
Anzeige
AW: schneller mit Excel4Makros - PAGE.SETUP
25.03.2009 16:39:20
Overdue
ot
;

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Entdecke mehr
Finde genau, was du suchst

Die erweiterte Suchfunktion hilft dir, gezielt die besten Antworten zu finden

Suche nach den besten Antworten
Unsere beliebtesten Threads

Entdecke unsere meistgeklickten Beiträge in der Google Suche

Top 100 Threads jetzt ansehen
Anzeige