Private Sub Command1_Click() With CommonDialog1 .Flags = CommonDialog1.Flags Or PrinterConstants.cdlPDPrintSetup .CancelError = True On Error Resume Next Call .ShowPrinter If Err.Number <> ErrorConstants.cdlCancel Then Call MsgBox("here, please implement the process after the end of the printer settings") End If End WithEnd Sub