تفضل أخى
Sub PDF_SAVE()
Dim PDF_Name As String
On Error Resume Next
F_path = ThisWorkbook.Path
F_Name = Range("J4").Value
PDF_Name = F_path & "\" & F_Name & ".pdf"
If Not Dir(PDF_Name, vbDirectory) <> vbNullString Then
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
PDF_Name, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True
Else
MsgBox "هذا الملف موجود مسبقا"
End If
End Sub
حفظ ملف بامتداد PDF.rar