View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default BeforePrint Add In

If I need to put code into the
thisworkbook of each spreadsheet, why even bother creating an xla?


You don't. That is the point of using application level events.

I am not sure why you are having an extended discussion with Ben then
posting below my post as if my suggestion was something different.. We both
suggested the same thing. Just continue your discussion with Ben.

--
Regards,
Tom Ogilvy






"Daniel McCollick" wrote in message
...
This still requires you to program at the thisworkbook level?! My

ultimate
goal is to have any excel spreadsheet that has this add in installed,

print
the specified header/footer, from the xla. If I need to put code into the
thisworkbook of each spreadsheet, why even bother creating an xla?
--
Dan McCollick


"Tom Ogilvy" wrote:

Instantiate Application Level Events in the Addin

http://www.cpearson.com/excel/appevent.htm
A Chip Pearson's site will give you a start point.

--
Reards,
Tom Ogilvy


"Daniel McCollick" wrote in message
...
Hello Everybody,
I have a custom header and footer currently in code. I want to pull

this
code to a add in so I can distribute any changes, etc. When I put the

code
into xla, the thisworkbook.beforeprint is no longer valid. I.e. How

do I
call beforeprint to the active sheet?

Current Code:
Private Sub beforePrint(Cancel As Boolean)

ActiveSheet.PageSetup.RightHeader = "Blah Blah Blah"
ActiveSheet.PageSetup.LeftFooter = "Blah Blah Blah Blah"
ActiveSheet.PageSetup.RightFooter = "Blah Blah, Blahblah blah"
end sub


--
Dan McCollick