Auxie
10-18-2017, 06:35 AM
Dim strFilename, strDirname, strPathname, strDefpath As StringOn Error Resume Next ' If directory exist goto next linestrDirname = Range("Y3").Value ' New directory name
strFilename = Range("Y3").Value 'New file namestrDefpath = "\\path"'Default path nameIf IsEmpty(strDirname) Then Exit SubIf IsEmpty(strFilename) Then Exit Sub
MkDir strDefpath & "\" & strDirnamestrPathname = strDefpath & "\" & strDirname & "\" & strFilename 'create total string
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=Range("Y3").Value _ , Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _ :=False, OpenAfterPublish:=True
Hey,
I am having trouble with the above code - its creating the folder and the pdf but it does not save it.. I'm probably missing something super simple but im failing to spot it.
Thanks in advance.
strFilename = Range("Y3").Value 'New file namestrDefpath = "\\path"'Default path nameIf IsEmpty(strDirname) Then Exit SubIf IsEmpty(strFilename) Then Exit Sub
MkDir strDefpath & "\" & strDirnamestrPathname = strDefpath & "\" & strDirname & "\" & strFilename 'create total string
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=Range("Y3").Value _ , Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _ :=False, OpenAfterPublish:=True
Hey,
I am having trouble with the above code - its creating the folder and the pdf but it does not save it.. I'm probably missing something super simple but im failing to spot it.
Thanks in advance.