kneehot
Altın Üye
- Katılım
- 4 Ekim 2007
- Mesajlar
- 632
- Excel Vers. ve Dili
- OFFİCE 365
- Altın Üyelik Bitiş Tarihi
- 06-10-2025
arkadaslar iyi aksamlar. elimde asagıdakı makro var bır yerınde degısıklık yapıyorum baslıkta yazdıgım hata cıkıyor. kırmızı ıle yazdıgım yerı kapatıp yasıl ıle yazdıgım yerı acıyorum bu hatayı verıyor. dosya yolunu duzeltıyorum ordan kaynaklanmıyor. yardımcı olursanız cok sevınırm.herkese tesekkurler.
Sub RDB_Selection_Range_To_PDF()
Dim FileName As String
If ActiveWindow.SelectedSheets.Count > 1 Then
MsgBox "There is more then one sheet selected," & vbNewLine & _
"ungroup the sheets and try the macro again"
Else
'Call the function with the correct arguments
'For a fixed range use this line
'FileName = RDB_Create_PDF(Range("A10:I15"), "", True, True)
'For the selection use this line
'FileName = RDB_Create_PDF(Selection, "", True, True)
'For a fixed file name and overwrite it each time you run the macro use
'RDB_Create_PDF(Selection, "C:\Users\Ron\Test\YourPdfFile.pdf", True, True)
If FileName <> "" Then
'Ok, you find the PDF where you saved it
'You can call the mail macro here if you want
Else
MsgBox "Not possible to create the PDF, possible reasons:" & vbNewLine & _
"Microsoft Add-in is not installed" & vbNewLine & _
"You Canceled the GetSaveAsFilename dialog" & vbNewLine & _
"The path to Save the file in arg 2 is not correct" & vbNewLine & _
"You didn't want to overwrite the existing PDF if it exist"
End If
End If
End Sub
Sub RDB_Selection_Range_To_PDF()
Dim FileName As String
If ActiveWindow.SelectedSheets.Count > 1 Then
MsgBox "There is more then one sheet selected," & vbNewLine & _
"ungroup the sheets and try the macro again"
Else
'Call the function with the correct arguments
'For a fixed range use this line
'FileName = RDB_Create_PDF(Range("A10:I15"), "", True, True)
'For the selection use this line
'FileName = RDB_Create_PDF(Selection, "", True, True)
'For a fixed file name and overwrite it each time you run the macro use
'RDB_Create_PDF(Selection, "C:\Users\Ron\Test\YourPdfFile.pdf", True, True)
If FileName <> "" Then
'Ok, you find the PDF where you saved it
'You can call the mail macro here if you want
Else
MsgBox "Not possible to create the PDF, possible reasons:" & vbNewLine & _
"Microsoft Add-in is not installed" & vbNewLine & _
"You Canceled the GetSaveAsFilename dialog" & vbNewLine & _
"The path to Save the file in arg 2 is not correct" & vbNewLine & _
"You didn't want to overwrite the existing PDF if it exist"
End If
End If
End Sub