The problem is that you need to select UsedRange and then use Selection.ExportAsFixedFormat
Sub GetSaveAsFilename() Dim fileName As String fileName = Application.GetSaveAsFilename(InitialFileName:="", _ FileFilter:="PDF Files (*.pdf), *.pdf", _ Title:="Select Path and FileName to save") If fileName <> "False" Then 'Selecting the Used Range in the Sheet ActiveWorkbook.Worksheets("Sheet1").UsedRange.Select 'Saving the Selection - Here is where the problem was Selection.ExportAsFixedFormat Type:=xlTypePDF, fileName:=fileName, _ Quality:=xlQualityStandard, IncludeDocProperties:=False, _ IgnorePrintAreas:=False, OpenAfterPublish:=True End If End Sub
EDIT:
The problem was PageSetup , because each page size has a maximum pixel limit when you are sent to your comment.
The page size is set to Oversize A0, which should more than satisfy 100x1500 UsedRange . Here you resize the page using FitToPages... = 1 to verify that your Range is within the print lines. A.
FitToPagesWide and FitToPagesTall should all fit on one page.
Sub GetSaveAsFilename() Dim fileName As String fileName = Application.GetSaveAsFilename(InitialFileName:="", _ FileFilter:="PDF Files (*.pdf), *.pdf", _ Title:="Select Path and FileName to save") If fileName <> "False" Then 'Suspending Communicaiton with Printer to Edit PageSetup via Scripting Application.PrintCommunication = False 'Setting Page Setup With ActiveSheet.PageSetup .FitToPagesWide = 1 .FitToPagesTall = 1 ' Setting Page Size to 92x92 inch Should cater for your data .PaperSize = 159 End With 'Enabling Communicaiton with Printer Application.PrintCommunication = True 'Selecting the Used Range in the Sheet ActiveWorkbook.Worksheets("Sheet1").UsedRange.Select 'Saving the Selection - Here is where the problem was Selection.ExportAsFixedFormat Type:=xlTypePDF, fileName:=fileName, _ Quality:=xlQualityStandard, IncludeDocProperties:=True, _ IgnorePrintAreas:=True, OpenAfterPublish:=True End If End Sub
Please note that the page will be blank, you will need to zoom in to view the data
source share