Hello,
can anybody help pls? I have file with userform updating header and footer data to another sheet. When exporting data sheet to pdf, there is one part of code, which updates Header and footer according data saved on 'settings sheet'. It works in debug mode, but not working in runtime. It just do not update leftfooter...
below is part of the code where creating simple string variables for header/footer and then applying data on sheet 'sh'.
Thank you in advance.
Brgds,
Tomas
can anybody help pls? I have file with userform updating header and footer data to another sheet. When exporting data sheet to pdf, there is one part of code, which updates Header and footer according data saved on 'settings sheet'. It works in debug mode, but not working in runtime. It just do not update leftfooter...
below is part of the code where creating simple string variables for header/footer and then applying data on sheet 'sh'.
Thank you in advance.
Brgds,
Tomas
VBA Code:
strCentHeaderText = "&""-,Bold""&18&K63BA26" & UCase(office) & " data list" & ""
strRightHeader = "&""-,Bold""&8&K00-049Version: " & strVer & Chr(10) & "First date: " & strFirstDate & Chr(10) & "Second date: " & strSecondDate
strLeftFooter = "&""-,Bold""&8&K00-045Owner: " & strOwner
strCenterFooter = "&""-,Bold""&K00-047XX1 | XX2 | XX3 | XX4 "
Application.PrintCommunication = False
With sh.PageSetup
.LeftHeader = "&G"
.CenterHeader = strCentHeaderText
.RightHeader = strRightHeader
.LeftFooter = strLeftFooter
.CenterFooter = strCenterFooter
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.5)
.RightMargin = Application.InchesToPoints(0.1)
.TopMargin = Application.InchesToPoints(0.75)
.BottomMargin = Application.InchesToPoints(0.75)
.HeaderMargin = Application.InchesToPoints(0.3)
.FooterMargin = Application.InchesToPoints(0.3)
.Zoom = 96
.PrintErrors = xlPrintErrorsDisplayed
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.ScaleWithDocHeaderFooter = True
.AlignMarginsHeaderFooter = False
.EvenPage.LeftHeader.text = ""
.EvenPage.CenterHeader.text = ""
.EvenPage.RightHeader.text = ""
.EvenPage.LeftFooter.text = ""
.EvenPage.CenterFooter.text = ""
.EvenPage.RightFooter.text = ""
.FirstPage.LeftHeader.text = ""
.FirstPage.CenterHeader.text = ""
.FirstPage.RightHeader.text = ""
.FirstPage.LeftFooter.text = ""
.FirstPage.CenterFooter.text = ""
.FirstPage.RightFooter.text = ""
End With
Application.PrintCommunication = True