Export every sheet like .pdf with its own name

avisoft20

Board Regular
Joined
Sep 10, 2016
Messages
64
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

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
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,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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