Hello everyone
I am trying to create individual pdf file for three active sheets (Cola, Pepsi and Fanta) and want to save them in the same folder as where the current excel workbook is saved. i have codes below and the pdf files are created okay but they are being saved in different folder to the excel workbook. i cant figure it out why and how to fix it. can you please help?
I have saved the workbook and closed and re-opened it and the pdf files are still saved in the wrong place....
Also i thought if dont specify the path, the pdf should be saved in the same folder where the active workbook is saved by default??
Thank you in advance!
Codes that i have at the moment are...
Sheets("Cola").Select
Dpath = "Cola" & Format(Range("h7"), "mmmm yyyy")
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
Dpath, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True
Sheets("Pepsi").Select
Dpath = "Pepsi" & Format(Range("h7"), "mmmm yyyy")
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
Dpath, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True
Sheets("Fanta").Select
Dpath = "Fanta" & Format(Range("h7"), "mmmm yyyy")
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
Dpath, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True
Bookmarks