문제

Hey guys I'm trying to create a macro that prints pdfs. I have the PDF creation down the problem i am having is the file path location along with creating the file name based on the sheet name. I believe my coding for the file path is off. Maybe the quotations are misplaced. Ultimately this will be in a loop but I'll put that in once I get the file location situation fixed.

Sub PrintCoverSheets()
'
' PrintCoverSheets
'
'
fName = Replace(ActiveSheet.Name, " ", "")
ActiveSheet.ExportAsFixedFormat xlTypePDF, ThisWorkbook.Path "\"  & " fName" & " cover", xlQualityStandard, , , , , False
Selection.EntireColumn.Hidden = False

End Sub
도움이 되었습니까?

해결책

replace:

ThisWorkbook.Path "\"

with

ThisWorkbook.Path & "\"
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top