ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,726
- Office Version
- 2007
- Platform
- 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
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