1 2 3 4 5 6 7 8 9 10 11 12 13 14
| Sub Impression()
'Enregistrer en PDF sous dossier courant
On Error GoTo Catch
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True, _
FileName:=ActiveWorkbook.Path & "\" & Split(ActiveWorkbook.Name, ".")(0)
Catch:
Select Case Err.Number
Case 70
MsgBox "Le fichier n'a pa pu être remplacé. Il est peut-être ouvert", vbExclamation
Case Else
MsgBox "l'erreur suivante est survenue:" & vbLf & Err.Number & vbLf & Err.Description, vbCritical
End Select
End Sub |
Partager