View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Daniel McCollick[_2_] Daniel McCollick[_2_] is offline
external usenet poster
 
Posts: 11
Default BeforePrint Add In

So if I add the class module(as instructed in the link) to the add in's xla
will this work, or must I add it to personal.xls?


Thanks for the help
--
Dan McCollick


"ben" wrote:

That only applies to the workbook that the code is in. Since you never
actually print the XLA it never activates.

see the following website to see how to apply to all workbooks

http://www.cpearson.com/excel/AppEvent.htm

ben

--
When you lose your mind, you free your life.


"Daniel McCollick" wrote:

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