Export every sheet like .pdf with its own name

avisoft20

Board Regular
Joined
Sep 10, 2016
Messages
63
Hi,
I am trying to create pdf from excel workbook.but pdf will save with their own name..i have multiple sheet in a single workbook

Example:
sheet1-Jan
sheet2-feb
sheet3-march

I wana to save all .pdf in same directory.
jan.pdf
feb.pdf
march.pdf
I am using this VBA code :
Option Explicit

Sub SheetsToPDFs()

Dim strPath As String
Dim wks As Worksheet

strPath = ActiveWorkbook.Path & ""

For Each wks In ActiveWorkbook.Worksheets
wks.ExportAsFixedFormat xlTypePDF, strPath & wks.Name & ".pdf"
Next wks

End Sub

But when i run this code my signature i.e in image format it not showing

Thanks
avisoft
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Hi,
I am trying to create pdf from excel workbook.but pdf will save with their own name..i have multiple sheet in a single workbook

Example:
sheet1-Jan
sheet2-feb
sheet3-march

I wana to save all .pdf in same directory.
jan.pdf
feb.pdf
march.pdf
I am using this VBA code :
Option Explicit

Sub SheetsToPDFs()

Dim strPath As String
Dim wks As Worksheet

strPath = ActiveWorkbook.Path & ""

For Each wks In ActiveWorkbook.Worksheets
wks.ExportAsFixedFormat xlTypePDF, strPath & wks.Name & ".pdf"
Next wks

End Sub

But when i run this code my signature i.e in image format it not showing

Thanks
avisoft
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,559
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top