PC Review


Reply
Thread Tools Rate Thread

Before Print Event

 
 
Dave M
Guest
Posts: n/a
 
      18th Apr 2008
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

 
Reply With Quote
 
 
 
 
Jim Rech
Guest
Posts: n/a
 
      18th Apr 2008
Runs fine here. Be sure events are enabled.

--
Jim
"Dave M" <(E-Mail Removed)> wrote in message
news:B24C9F20-29FC-4593-AE86-(E-Mail Removed)...
|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
|


 
Reply With Quote
 
Dave M
Guest
Posts: n/a
 
      18th Apr 2008
When I hit 'F8' to run through the code, it looks like it runs proper, but
the footer is not updated!

"Jim Rech" wrote:

> Runs fine here. Be sure events are enabled.
>
> --
> Jim
> "Dave M" <(E-Mail Removed)> wrote in message
> news:B24C9F20-29FC-4593-AE86-(E-Mail Removed)...
> |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
> |
>
>
>

 
Reply With Quote
 
Jim Rech
Guest
Posts: n/a
 
      18th Apr 2008
Well, it updates here so the code is okay. I don't know why it doesn't
result in a changed footer for you.

--
Jim
"Dave M" <(E-Mail Removed)> wrote in message
news:63167515-18F1-4349-8D90-(E-Mail Removed)...
| When I hit 'F8' to run through the code, it looks like it runs proper, but
| the footer is not updated!
|
| "Jim Rech" wrote:
|
| > Runs fine here. Be sure events are enabled.
| >
| > --
| > Jim
| > "Dave M" <(E-Mail Removed)> wrote in message
| > news:B24C9F20-29FC-4593-AE86-(E-Mail Removed)...
| > |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
| > |
| >
| >
| >


 
Reply With Quote
 
dan dungan
Guest
Posts: n/a
 
      18th Apr 2008
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.


 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      18th Apr 2008
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.



Dave M wrote:
>
> When I hit 'F8' to run through the code, it looks like it runs proper, but
> the footer is not updated!
>
> "Jim Rech" wrote:
>
> > Runs fine here. Be sure events are enabled.
> >
> > --
> > Jim
> > "Dave M" <(E-Mail Removed)> wrote in message
> > news:B24C9F20-29FC-4593-AE86-(E-Mail Removed)...
> > |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
> > |
> >
> >
> >


--

Dave Peterson
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Event Type: Error, Event Source: Print, Event ID: 23 =?Utf-8?B?UmFodWw=?= Windows XP Print / Fax 2 6th May 2006 01:27 PM
Event ID: 61,Event Source: Print kg Microsoft Windows 2000 Windows Updates 0 10th Sep 2004 01:01 PM
errror print event id 20 e event id 26 Andrea Microsoft Windows 2000 Printing 0 8th Sep 2004 08:03 AM
Print Error - Event ID 45 and 61. Only administrators can print. DanF Microsoft Windows 2000 Printing 2 4th Aug 2004 04:32 PM
Event 7031 and event 61 on windows 2000 print server: what to do? Pierre Microsoft Windows 2000 Printing 1 17th Jul 2003 05:36 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:58 AM.