1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Sub impress_pdf()
With ActiveSheet
On Error Resume Next
.Name = .Range("L3") '
If Err.Number <> 0 Then
MsgBox ("Nom invalide") '
Exit Sub 's
End If
End With
Dim i As Long
Application.ScreenUpdating = False
On Error Resume Next
'MkDir "c:\mesdocuments"
For i = 1 To 1
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:="C:\Users\.....\......\" & Sheets(i).Name & ".pdf"
Next i
Sheets(1).Select
Application.ScreenUpdating = True
MsgBox ("La facture " & Sheet.Name & " PDF viennent d'être créée et est disponnible dans le répertoire C:\mesdocuments\.....")
End Sub |