Print an excel sheet in pdf by saving it with the sheet name as filename

Forum for the PDF-XChange Editor - Free and Licensed Versions

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

Davide78
User
Posts: 171
Joined: Fri Mar 10, 2023 9:14 pm

Print an excel sheet in pdf by saving it with the sheet name as filename

Post by Davide78 »

Hi, I haven't been able to find a solution directly in Excel (even via macro) to print/save an Excel sheet with filename.pdf = sheet name of the Excel file printed (filename.pdf = Excel file name + sheet name of the Excel file printed would also be fine)
I ask you if it would be possible, deciding to print an Excel sheet with your program, to obtain this result.
Thanks in advance
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 11277
Joined: Wed Jan 03, 2018 6:52 pm

Re: Print an excel sheet in pdf by saving it with the sheet name as filename

Post by Daniel - PDF-XChange »

Hello, Davide78

It is not possible to include the sheet name when printing using any features we offer. Even our office toolbar addin, the closes we do offer is that if you convert the entire XLSX file into one PDF file, you have the option to make bookmarks, which are named per sheet:
image.png
Doing so would result in one PDF file, which looks like this:
image(1).png
And following that, you could then use the "split document" function, to split the document by bookmarks:
image(2).png
Which gave me this:
image(3).png
It is a few extra steps, but I hope this option helps.

Kind regards,
You do not have the required permissions to view the files attached to this post.
Dan McIntyre - Support Technician
PDF-XChange Co. LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
Davide78
User
Posts: 171
Joined: Fri Mar 10, 2023 9:14 pm

Re: Print an excel sheet in pdf by saving it with the sheet name as filename

Post by Davide78 »

Too bad, but thanks anyway because you explained a function that I didn't know.
I realize that what I'm asking should be integrated into Excel, but I haven't found any solutions in their program.
Greetings
Willy Van Nuffel
User
Posts: 2750
Joined: Wed Jan 18, 2006 12:10 pm

Re: Print an excel sheet in pdf by saving it with the sheet name as filename

Post by Willy Van Nuffel »

Maybe this macro might help ?

Code: Select all

Sub SaveSheetAsPDF()
            ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:="C:\Willy\" & ActiveWorkbook.Name & " - " & ActiveSheet.Name & ".pdf"
End Sub
Davide78
User
Posts: 171
Joined: Fri Mar 10, 2023 9:14 pm

Re: Print an excel sheet in pdf by saving it with the sheet name as filename

Post by Davide78 »

Oh thank you! In the meantime I managed to find a VBA macro that solved the problem for me! thanks for sharing your macro, if it can be useful I will do the same.
I continue asking you if there could be a "javascripit" to insert in your program to perform the operation... I only know "scrollsync" that was suggested to me and that I use daily, but I do not know well the customization possibilities of PDF-Xchange Editor, but from what I have seen it is easier to manage a "javascript" in PDF-Xchange Edtor than a VBA macro in Excel.
Regards
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 11277
Joined: Wed Jan 03, 2018 6:52 pm

Re: Print an excel sheet in pdf by saving it with the sheet name as filename

Post by Daniel - PDF-XChange »

Hello, Davide78

Sadly I do not believe there is any way for JS to be used from inside the Editor, to control such aspect of conversion from another format.

Kind regards,
Dan McIntyre - Support Technician
PDF-XChange Co. LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com