habe folgendes Makro, wechlse ich mit einer Prüfung vershen möchte ob ein Drucker angeschlossen ist.
Geht das ?
Hier mein Makro:
'----------- Druck-Button --------------------------
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Worksheets("Muster-Halle").Select
Range("A1").Select
Dim kbl_verkäufer
kbl_verkäufer = Sheets("Muster-Halle").[F12]
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints(0.2) 'linker Rand
.RightMargin = Application.InchesToPoints(0.4) 'rechter Rand
.TopMargin = Application.InchesToPoints(0.15) 'oberer Rand
.BottomMargin = Application.InchesToPoints(0.25) 'unterer Rand
.HeaderMargin = Application.InchesToPoints(0.01) 'Kopfzeile
.FooterMargin = Application.InchesToPoints(0.01) 'Fußzeile
.Zoom = 97
' .Orientation = xlLandscape 'Querformat
.Orientation = xlPortrait 'Hochformat
End With
With ActiveSheet.PageSetup
.LeftFooter = "&""Courier New,Standard""&6" & "erstellt: " & _
kbl_verkäufer & " am: &D/&T"
.RightFooter = "&""Courier New,Standard""&6 " & _
getStrUpdate()
End With
Range("B1:R74").Select
ActiveSheet.PageSetup.PrintArea = "$B$1:$R$74"
Range("C1").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Worksheets("Muster-Halle").Select
Range("A1").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios _
:=True, Password:="xx"
TextBox2.SetFocus
With TextBox2
.SetFocus
.SelStart = 0
.SelLength = Len(.Text)
End With
Application.ScreenUpdating = True
End Sub
Gruß Walter