J
jsandstr
Hi,
I writing a workbookbeforesave event but can't get my
PageSetup.LeftFooter to work. The event is executed it is just the
Pagesetup that doesn't work. Is there any known problem with this? I
running excel 2003 sp2.
ws.PageSetup.CenterHeader = "test" '''doesn't work
ws.Range("A4") = "test" ''' works
Code in a Class Module:
Public WithEvents App As Application
Private Sub App_WorkbookBeforeSave(ByVal Wb As Workbook, ByVal
SaveAsUI As Boolean, Cancel As Boolean)
Dim SecurityLevel()
SecurityLevel = Array("Secret", "Confidential", "Proprietary",
"Public")
On Error Resume Next
Do Until Level = 1 Or Level = 2 Or Level = 3 Or Level = 4
Level = InputBox("To AFR secure this document type in security
level, otherwise cancel.1 = Secret, 2 = Confidential, 3 = Proprietary
and 4 = Public.", "Update the date")
If Level = 0 Then
Exit Sub ''' Cancel pressed
End If
Loop
Wb.Worksheets("Sheet1").PageSetup.LeftFooter =
Application.UserName & ", " & "&D" & Chr(10) & "Security Class <" &
SecurityLevel(Level) & ">"
However this works
ws.Worksheets("Sheet1").Range("A2") = "test"
End Sub
Regards
JS
I writing a workbookbeforesave event but can't get my
PageSetup.LeftFooter to work. The event is executed it is just the
Pagesetup that doesn't work. Is there any known problem with this? I
running excel 2003 sp2.
ws.PageSetup.CenterHeader = "test" '''doesn't work
ws.Range("A4") = "test" ''' works
Code in a Class Module:
Public WithEvents App As Application
Private Sub App_WorkbookBeforeSave(ByVal Wb As Workbook, ByVal
SaveAsUI As Boolean, Cancel As Boolean)
Dim SecurityLevel()
SecurityLevel = Array("Secret", "Confidential", "Proprietary",
"Public")
On Error Resume Next
Do Until Level = 1 Or Level = 2 Or Level = 3 Or Level = 4
Level = InputBox("To AFR secure this document type in security
level, otherwise cancel.1 = Secret, 2 = Confidential, 3 = Proprietary
and 4 = Public.", "Update the date")
If Level = 0 Then
Exit Sub ''' Cancel pressed
End If
Loop
Wb.Worksheets("Sheet1").PageSetup.LeftFooter =
Application.UserName & ", " & "&D" & Chr(10) & "Security Class <" &
SecurityLevel(Level) & ">"
However this works
ws.Worksheets("Sheet1").Range("A2") = "test"
End Sub
Regards
JS