changing footer before save

  • Thread starter Karthik Palaniappan
  • Start date
K

Karthik Palaniappan

Hello Everyone

We want to change the footer when the save event occurs. To do so, we wrote our code in subroutine objApp_WorkbookBeforeSave . We have confirmed that the subroutine objApp_WorkbookBeforeSave gets executed when a workbook is saved by tracing the execution. Although, every statement in the subroutine gets executed, the footer does not change. Can someone please help

Following is our code in Subroutine WorkbookBeforeSave

Private Sub objXLApp_WorkbookBeforeSave(ByVal wbkSaveBook
As Excel.Workbook, ByVal blnSaveAsUI As Boolean,
Cancel As Boolean

Dim shtSheet As Objec
Dim strHeaderFooter As Strin


wbkSaveBook.ActiveSheet.Range("a1").Value = "india

' Put the footer into all sheet
For Each shtSheet In wbkSaveBook.Sheet


With shtSheet.PageSetu

.LeftHeader = "LH
.CenterHeader = "CH
.RightHeader = "RH
.LeftFooter = "LF
.CenterFooter = "CF
.RightFooter = "RF

End Wit

Next shtShee

End Su

We are using excel 2000

Thanks
Karthi
 
B

Bob Phillips

Works fine for me.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

Karthik Palaniappan said:
Hello Everyone,

We want to change the footer when the save event occurs. To do so, we
wrote our code in subroutine objApp_WorkbookBeforeSave . We have confirmed
that the subroutine objApp_WorkbookBeforeSave gets executed when a workbook
is saved by tracing the execution. Although, every statement in the
subroutine gets executed, the footer does not change. Can someone please
help.
 
K

Karthik Palaniappan

Hi Bob

Thank you for the quick response.

May I know the version number of Excel in your PC. for example, mine is Excel 2000 version 9.0.0.3822.

Thanks
Karthik
 
B

Bob Phillips

Karthik,

Mine is Excel 2000 version 9.0.3821 SR-1, XP pro.

But it seems straightforward what you are doing, so it should work.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top