gokuthemighty
New Member
- Joined
- Sep 1, 2014
- Messages
- 2
Hello I am new to excel and using windows & 64 bit and Excel 2013
For work we have to save in a file based on the month. The same lines of code work in a saveas macro but give me errors in every way I try them in a covert to pdf. Can anyone tell me what is wrong with this code? Thanks.
[Sub SaveAsPDF()
Dim str As String
str = ThisWorkbook.Path
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:="str & "\" & "SW Patrol " & Format(DateAdd("d", -1, Date), "m-dd-YY").pdf", _
OpenAfterPublish:=True
End Sub]
For work we have to save in a file based on the month. The same lines of code work in a saveas macro but give me errors in every way I try them in a covert to pdf. Can anyone tell me what is wrong with this code? Thanks.
[Sub SaveAsPDF()
Dim str As String
str = ThisWorkbook.Path
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:="str & "\" & "SW Patrol " & Format(DateAdd("d", -1, Date), "m-dd-YY").pdf", _
OpenAfterPublish:=True
End Sub]