Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Footer
Hello
When using the following code in a BeforePrint subroutine, the footer is not being updated, although the code runs without error: With ActiveSheet.PageSetup .LeftFooter = "&05" & strA & strC & strB & strS _ & Chr(10) & strFN End With What goes wrong? Regards, Walter Hofmann |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Footer
There is nothing wrong with the code per se. Are the variables, "strA",
etc. visible to this module? I'd guess not. If you put an "Option Explicit" at the top of this module (and every module by selecting "Require variable declaration" under Tools, Options, Editor in the VBE, that's what the pros do), this problem would pop up immediately as an error. If strA, etc. is defined in another module you have to declare them as Public at the top of their module. -- Jim Rech Excel MVP |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Footer
Dear Jim All str variables are defined in the subroutine and there is an option explicit. When I trace the code, the contents of the variables are correct, it's just the assignment to the .footer that doesn't work. Walter *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Footer
Hmmm.. Does a slightly dumbed down version work?
Private Sub Workbook_BeforePrint(Cancel As Boolean) ActiveSheet.PageSetup.LeftFooter = "abc" End Sub -- Jim Rech Excel MVP |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Footer
The problem was that the code for the footer was in the BeforeSave
subroutine, which I called from the BeforePrint subroutine. I now have made a 3rd subroutine which is being called from both BeforePrint and BeforeSave. Like this all works as expected. Walter *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Footer | Excel Discussion (Misc queries) | |||
Excel footer to look like Word footer? | Excel Discussion (Misc queries) | |||
Footer in XL | Excel Worksheet Functions | |||
Footer | Excel Discussion (Misc queries) | |||
Footer | Excel Worksheet Functions |