Print Setup
The following code does what is needed correctly, EXCEPT
the correct file name does not show up correctly unless:
After the whole procedure is finished, you then go into
page setup, go to the Headers/Footers tab, click on Custom
Footers, then just click OK,and OK again and then the file
name derived from "&[File]" appears correctly. I've tried
placing "&[File]" in different parts of the code, but
still, it won't recognize it until you go back into the
Custom Footer section and just click OK.
Is there some type of refresh command that I can use for
the Page Setup section? Thank you.
thepth is derived from the code before the following:
rgtft = "&[File]"
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = "&""Arial,Bold""&16&E" &
ActiveCell.Value & Chr(10) & "&12&E" & ActiveCell.Offset
(rowoffset:=1, columnoffset:=0)
.LeftFooter = Format(Date, "mm/dd/yyyy")
thisfile = thepth
.RightFooter = "&""Arial""&7" & thisfile & "\" &
rgtft
.CenterFooter = "&8&P of &N"
.Orientation = xlLandscape
.LeftMargin = Application.InchesToPoints(0.5)
.RightMargin = Application.InchesToPoints(0.5)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
End With
|