Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / April 2008

Tip: Looking for answers? Try searching our database.

Before Print Event

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dave M - 18 Apr 2008 14:04 GMT
I can't get this code to work proper in the event.  When I run the code by
itself, it works no problem, but when it is in the event, it runs through the
code but does not update the footer, the code is in 'ThisWorkbook':

Sub Workbook_Beforeprint(Cancel As Boolean)
  Dim foot As String
     foot = "Report Printed on " & Format(Now, "DD MMMM YYYY") & " at " &
Format(Now, "H:MM am/pm")
     Worksheets("Report").PageSetup.RightFooter = foot

End Sub
Jim Rech - 18 Apr 2008 14:24 GMT
Runs fine here.  Be sure events are enabled.

Signature

Jim

|I can't get this code to work proper in the event.  When I run the code by
| itself, it works no problem, but when it is in the event, it runs through the
[quoted text clipped - 7 lines]
|
| End Sub
Dave M - 18 Apr 2008 14:34 GMT
When I hit 'F8' to run through the code, it looks like it runs proper, but
the footer is not updated!

> Runs fine here.  Be sure events are enabled.
>
[quoted text clipped - 10 lines]
> |
> | End Sub
Jim Rech - 18 Apr 2008 15:22 GMT
Well, it updates here so the code is okay.  I don't know why it doesn't
result in a changed footer for you.

Signature

Jim

| When I hit 'F8' to run through the code, it looks like it runs proper, but
| the footer is not updated!
[quoted text clipped - 13 lines]
| > |
| > | End Sub
Dave Peterson - 18 Apr 2008 17:57 GMT
There was another thread (within the last month???) where different user had the
same problem.  The code would always work for me.

His solution was to add a button that would fix the header and print the job.

> When I hit 'F8' to run through the code, it looks like it runs proper, but
> the footer is not updated!
[quoted text clipped - 15 lines]
> > |
> > | End Sub

Signature

Dave Peterson

dan dungan - 18 Apr 2008 17:31 GMT
I put this in a workbook. After I changed the sheet name to Report, it
printed "Report Printed on 18 April at 9:30 am" in the lower right
hand corner of the page.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.