VB - path location in footer

  • Thread starter Thread starter Bonnie
  • Start date Start date
B

Bonnie

Hi,

I got how to put the path in the current workbook. But, is
there a way to put that in the all my workbooks existing
and new without having to configure it everytime.

(Frank in Germany) I think you answered this for me a
couple of days ago.

thanks B.
 
Hi
you may create a new workbook template with this code included. But
this works only for new workbooks. I think for your existing ones you
have to configure each separately
 
Bonnie,

As Frank said, you can't do it for previous workbooks, but you can set it up
so that all workbooks print this value. To do this you need application
events, and put this is a separate workbook, such as Personal.xls, and then
any workbook will adopt these properties. No need to code each workbook with
it.

This is what you need to do.

Firstly, all of this code goes in the source workbook.

'========================================
Insert a class module, rename it to 'clsAppEvents', with this code

Option Explicit

Public WithEvents App As Application

Private Sub App_WorkbookBeforePrint(ByVal Wb As Workbook, Cancel As Boolean)
With Wb.ActiveSheet
.PageSetup.LeftFooter = Wb.FullName
End With
End Sub

'========================================
In ThisWorkbook code module, add this event code

Dim AppClass As New clsAppEvents

Private Sub Workbook_Open()

Set AppClass.App = Application

End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
I was trying to reach your link. It goes into an infinite loop & does not
reach the target page
 
Back
Top