Hi All ,

I need to convert multiple worksheets to the PDF. I've found below script in http://msdn.microsoft.com/en-us/libr...ice.11%29.aspx and tried to modify it for my case. It's not working.

Sub RDB_Worksheet_Or_Worksheets_To_PDF()
Dim FileName As String
If ActiveWindow.SelectedSheets.Count > 1 Then
    MsgBox "There is more than one sheet selected," & vbNewLine & _
    "and every selected sheet will be published."
End If
'Call the function with the correct arguments.
'You can also use Sheets("Sheet3") instead of ActiveSheet in the code(the sheet does not need to be active then).
FileName = RDB_Create_PDF(ActiveSheet, "", True, True)
'For a fixed file name and to overwrite it each time you run the macro, use the following statement.
'RDB_Create_PDF(ActiveSheet, "C:\Users\Ron\Test\YourPdfFile.pdf", True, True)
If FileName <> "" Then
    'Uncomment the following statement if you want to send the PDF by e-mail.
     'RDB_Mail_PDF_Outlook FileName, "ron@debruin.nl", "This is the subject", _
     "See the attached PDF file with the last figures" _
     & vbNewLine & vbNewLine & "Regards Ron de bruin", False
Else
    MsgBox "It is not possible to create the PDF; possible reasons:" & vbNewLine & _
    "Add-in is not installed" & vbNewLine & _
   "You canceled the GetSaveAsFilename dialog" & vbNewLine & _
   "The path to save the file is not correct" & vbNewLine & _
   "PDF file exists and you canceled overwriting it."
End If
End Sub