Forum Discussion
Taiff
Aug 19, 2022Copper Contributor
Protected Header and Footer (from Page Layout -> Page Setup) in Excel
Hi everyone, Excel has headers and footers via PageLayout -> PageSetup ->Header/Footer. How do I lock and protect from changes using passwords? Thanks in advance!
Taiff
Aug 19, 2022Copper Contributor
Thx NikolinoDE.
The problem I have is that both header and footer have images. Most solutions I've seen are about text-based content. Any idea how to do it reliably with images?
NikolinoDE
Aug 20, 2022Platinum Contributor
this should be adjusted and built into the worksheet, not the workbook.
Option Explicit
Private SubWorksheet_Activate()
Me.Unprotect ("1234")
ActiveSheet.PageSetup.LeftHeaderPicture.Filename = "C:\Documents and Settings\Nikolino\My Documents\My Pictures\MySelfFoto1.jpg"
ActiveSheet.PageSetup.RightHeaderPicture.Filename = "C:\Documents and Settings\Nikolino\My Documents\My Pictures\MySelfFoto2.jpg"
With ActiveSheet.PageSetup
.LeftHeader = "&G"
.CenterHeader = "Here the text for center header"
.RightHeader = "&G"
End With
Me.Protect ("1234")
End Sub
- TaiffAug 21, 2022Copper ContributorThx again!
The problem is that those images files will need to be present. Is it possible to say, place the graphics on a hidden sheet, and then somehow refer them in the header/footer?