Hey guys,
I hope you can assist me... I am trying to protect a document by having a particular footer appear every time a person saves. I have to make multiple versions of the document for different people and am battling to the get the image to change per saved version.
I, by the stroke of luck, got the 1st one to work, but now when I need to change the image in a new version, the original image remains. The text changes but the image does not.
The image is found in the same sheet - if there is a better way to do this, I would also welcome guidance.
I might be a little short on some code to help make this happen. Your kind assistance would be so appreciated.
Here is my code:
Sub Macro1()
With ActiveSheet.PageSetup.RightFooterPicture
.FileName = "Picture 5"
End With
ActiveSheet.PageSetup.RightFooter = "&G"
End Sub
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
With ws.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = "For exclusive use, as the facilitator, by Gatehouse"
.RightFooter = "&G"
End With
Next ws
End Sub
Thank you
I hope you can assist me... I am trying to protect a document by having a particular footer appear every time a person saves. I have to make multiple versions of the document for different people and am battling to the get the image to change per saved version.
I, by the stroke of luck, got the 1st one to work, but now when I need to change the image in a new version, the original image remains. The text changes but the image does not.
The image is found in the same sheet - if there is a better way to do this, I would also welcome guidance.
I might be a little short on some code to help make this happen. Your kind assistance would be so appreciated.
Here is my code:
Sub Macro1()
With ActiveSheet.PageSetup.RightFooterPicture
.FileName = "Picture 5"
End With
ActiveSheet.PageSetup.RightFooter = "&G"
End Sub
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
With ws.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = "For exclusive use, as the facilitator, by Gatehouse"
.RightFooter = "&G"
End With
Next ws
End Sub
Thank you