ich hoffe ihr habt eine Idee.
Ich würde gern in der Fußzeile (Center) ein Bild beim drucken mit VBA einfügen.
Der Code funktioniert bis auf das Ding mit dem Bild einfügen einwandfrei.
Habe es mit zwei Varianten probiert. Beide funktionieren nicht.
Va. 1: .CenterFooterPicture.Filename = [D22]
.CenterFooter ="&G"
Va. 2: .CenterFooterPicture.Filename = "C:\Dokument\Bild.jpg"
.CenterFooter = "&G"
(Beide Varianten mit und ohne CenterFooter = "&G")
Hier mein Code:
Sub DruckSchicht()
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Range("D1:AK24").Select
ActiveSheet.PageSetup.PrintArea = "$D$1:$AK$24"
Application.PrintCommunication = False
With ActiveSheet.PageSetup
.LeftMargin = Application.CentimetersToPoints(0.5)
.RightMargin = Application.CentimetersToPoints(0.5)
.TopMargin = Application.CentimetersToPoints(0.5)
.BottomMargin = Application.CentimetersToPoints(0.5)
.HeaderMargin = Application.CentimetersToPoints(0.5)
.FooterMargin = Application.CentimetersToPoints(0.5)
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
.LeftFooter = "erstellt von: " & Application.UserName
'.CenterFooterPicture.Filename = "C:\Dokument\Bild.jpg"
'.CenterFooter = "&G"
.RightFooter = "Datum: " & Date
End With
Application.PrintCommunication = True
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, IgnorePrintAreas:=False
'Selection.PrintOut Copies:=1, Collate:=True, IgnorePrintAreas:=False
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
Hoffe jemand hat eine Idee.
Danke schon im Vorraus :-)