VB - path location in footer

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.
 
F

Frank Kabel

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
 
B

Bob Phillips

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)
 
A

Android

I was trying to reach your link. It goes into an infinite loop & does not
reach the target page
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top