Results 1 to 5 of 5
  1. #1
    Lounger
    Join Date
    Apr 2001
    Location
    Glasgow, Lanarkshire, Scotland
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Inserting longfilename into headers/footers

    All,

    Word has a neat feature of inserting the full file name (e.g. c:worksheetstest.xls) as a footer for example (this is done by appending the /p switch.

    Is there a way of doing this in Excel 2k? I guess this will be possible using VBA - if so does anyone have the code I could borrow? ;-)

    tia,

    Andrew

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Inserting longfilename into headers/footers

    Hi Andrew,
    There's an add-in that will do it for you <A target="_blank" HREF=http://www.j-walk.com/ss/excel/files/general.htm>here</A> among other things. You can also search the forum for 'header' and there are various threads on this topic.
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Inserting longfilename into headers/footers

    You can use this as the before print event procedure for the workbook:

    <pre>Private Sub Workbook_BeforePrint(Cancel As Boolean)
    ActiveSheet.PageSetup.CenterFooter = ActiveWorkbook.Path & "" & ActiveWorkbook.Name
    End Sub
    </pre>


    This must be in the module behind the workbook object, not in a standard module.
    Legare Coleman

  4. #4
    2 Star Lounger
    Join Date
    Dec 2000
    Posts
    140
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Inserting longfilename into headers/footers

    The slickest (and scariest, still do not fully understand it...) utility is to be found here <A target="_blank" HREF=http://www.rb-ad.dircon.co.uk/rob/excelvba/utils/index.htm>http://www.rb-ad.dircon.co.uk/rob/ex...tils/index.htm</A>

    As the Excel command is intercepted and enhanced this has the following advantages:
    - Workbooks do not need VBA modules
    - Works with any workbook
    - Update if files are moved is automatically ensured.

  5. #5
    Lounger
    Join Date
    Apr 2001
    Location
    Glasgow, Lanarkshire, Scotland
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Inserting longfilename into headers/footers

    Neat site! - thanks for that.

    It still begs the question why have MS left this excellent functionality out of Excel?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •