LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default workbookbeforesave

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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
WorkbookBeforeSave Problem Steve Excel Discussion (Misc queries) 2 November 1st 09 10:01 AM
Worksheet.Unprotect within WorkbookBeforeSave event fails if Save Dean Meyer[_2_] Excel Programming 5 March 30th 09 04:19 PM
WorkbookBeforeSave CinqueTerra Excel Programming 2 January 12th 06 12:21 AM
Excel XP and WorkbookBeforeSave Dave McL. Excel Programming 2 December 5th 05 05:08 AM
Handling WorkbookBeforeClose and WorkbookBeforeSave Tom Ogilvy Excel Programming 0 September 19th 03 06:27 PM


All times are GMT +1. The time now is 05:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"