Saved pdf from worksheet doesnt show all the page

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,726
Office Version
  1. 2007
Platform
  1. Windows
I have a worksheet where i enter values then save as pdf.
When i open the folder to view / print pdf all is fine.

I needed to make a duplicate for another customer & have made row / column sizes the sam BUT when i view the pdf i only see half the page ?

This is the code i use to create pdf but what / where should i be looking for the issue.
Thanks

VBA Code:
Private Sub Generate_Pdf_Click()
    Dim strFileName As String
    
    strFileName = "C:\Users\Ian\Desktop\GRASS CUTTING\CURRENT GRASS SHEETS\CLAUDIA MCVIE\" & "INVOICE " & Range("L4").Value & " " & Format(Range("L13"), "dd-mm-yyyy") & ".pdf"
                          
    If Dir(strFileName) <> vbNullString Then
        MsgBox "GENERATED PDF INVOICE" & vbNewLine & vbNewLine & "INVOICE " & Range("L4").Value & vbNewLine & vbNewLine & "WAS NOT SAVED AS IT ALLREADY EXISTS", vbCritical + vbOKOnly, "GENERATE PDF FILE MESSAGE"
        Exit Sub
    End If
    
    With ActiveSheet
        .PageSetup.PrintArea = "$F$2:$N$61"
        .ExportAsFixedFormat Type:=xlTypePDF, Filename:=strFileName, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False
        pdf = MsgBox("GENERATED PDF INVOICE" & vbNewLine & vbNewLine & "INVOICE " & Range("L4").Value & vbNewLine & vbNewLine & "WAS SAVED SUCCESSFULLY", vbInformation + vbOKOnly, "GENERATE PDF FILE MESSAGE")
                                
        Range("L4").Value = Range("L4").Value + 1 'INVOICE IS INCREMATED BY 1
        ActiveWorkbook.Save
        
    End With
End Sub
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Yes but bearing in mind i copied an existing sheet which works fine so somewhere on the sheet must be a different setting etc
 
Upvote 0
All the same as taken from another sheet & i also checked it afterwards just in case
 
Upvote 0
Perhaps you can remove sensitive information from both worksheets and upload a workbook with them to a file sharing facility and give us a link to test?
 
Upvote 0

Forum statistics

Threads
1,223,702
Messages
6,173,961
Members
452,539
Latest member
delvey

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top