Jyggalag
Active Member
- Joined
- Mar 8, 2021
- Messages
- 445
- Office Version
- 365
- 2019
- Platform
- Windows
Hi all,
I have this overview at the moment:
If I manually choose to save my file as a PDF, it works fine and I get just 1 page with the overview above.
However, I have the following VBA code to save my file as a PDF:
But when I save my file with this macro, it saves the entire sheet and I get 4 pages of PDF, rather than the limited view I have set it to above.
Has anybody tried this before? Does anybody have a solution? @Fluff is this a bug maybe?
Thank you!
Kind regards,
Jyggalag
I have this overview at the moment:
If I manually choose to save my file as a PDF, it works fine and I get just 1 page with the overview above.
However, I have the following VBA code to save my file as a PDF:
VBA Code:
Option Explicit
Sub SaveFileWithMacro()
Dim Path As String
Dim fn As String
Path = "S:\COMPANY\TG_FDSL\DS_COMMON\PRIVATE FOLDER\18- PRIVATE SUBFOLDER\Tracking\PDF files\"
fn = Range("A61")
ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=Path & fn & ".pdf"
End Sub
But when I save my file with this macro, it saves the entire sheet and I get 4 pages of PDF, rather than the limited view I have set it to above.
Has anybody tried this before? Does anybody have a solution? @Fluff is this a bug maybe?
Thank you!
Kind regards,
Jyggalag