Remove - Sample Excel File Saved As PDF

oddworld

Active Member
Joined
May 31, 2005
Messages
250
Hi all, i would appreciate some help in removing a PDF header text- Sample Excel File Saved As PDF. I use the below subroutine to print my timesheet to PDF using the title generated from the vale in T1. The code works well, the issue is the PDF has a centred header applied during the creation of the PDF - "Sample Excel File Saved As PDF" . Does anyone have any knowledge on how to omit it?

[
Sub SaveAsPDF()
Dim filename As String
filename = "\\d85userdata.xxxx.xx\xxxxx\xxxxxxxx\My Documents\Time Sheets\" & Range("T1").Value
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, filename:= _
filename, Quality:=xlQualityStandard, IncludeDocProperties _
:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True
End Sub]

Regards,
Odd
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Hi Odd,
are you sure the header is not added from a macro? Try this code to clear it:
VBA Code:
Sub ClearHeader()
    With ActiveSheet.PageSetup
        .CenterHeader = ""
    End With
End Sub
 
Upvote 0
Solution
Hi Odd,
are you sure the header is not added from a macro? Try this code to clear it:
VBA Code:
Sub ClearHeader()
    With ActiveSheet.PageSetup
        .CenterHeader = ""
    End With
End Sub
Thank you Sequoyah, the clear header routine worked a treat - gold dust - cheers Odd.

 
Upvote 0

Forum statistics

Threads
1,214,611
Messages
6,120,509
Members
448,967
Latest member
screechyboy79

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