Seite wird plötzlich 2 mal gedruckt
06.08.2021 13:49:44
Dirk
ich habedas Problem, daß ein Druckbefehl aus VBA heraus plötzlich 2 mal ausgeführt wird.
Hier mein Code :
Option Explicit
Private Sub Image1_Click()
ThisWorkbook.Sheets("Feinstaubplakette").Activate
Range("D19").Select
ActiveCell.Offset(0, 0) = TextBox1.Value
If MsgBox(" Feinstaub-Plakette" & vbLf & " mit Schablone eingelegt ?", vbYesNo, "Feinstaub-Plakette drucken") = vbNo Then Exit Sub
Dim StdPr As String
StdPr = Application.ActivePrinter
Application.Dialogs(xlDialogPrint).Show
ThisWorkbook.Sheets("Feinstaubplakette").PrintOut
Application.ActivePrinter = StdPr
Range("D19").ClearContents
Unload Me
Load UFHM
UFHM.Show
End Sub
Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If KeyAscii >= Asc("a") And KeyAscii