Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Adelaide, South Australia, Australia
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Path in Caption (XL2000 SR1)

    I use a macro I found in one of Woody's newsletters to put the path in XL's title bar:
    Sub Opener()
    Application.Dialogs(xlDialogOpen).Show
    Application.ActiveWindow.Caption = ActiveWorkbook.FullName
    End Sub

    This is assigned to the open file button.

    However when several files are selected simutaneously from the Open dialog box, only the one opened last has the path in the caption. Can one of you VBA experts modify the macro so all the files opened show the path?

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Path in Caption (XL2000 SR1)

    Hi,

    Use this instead:

    Option Explicit

    Sub Opener()
    Dim vFileList As Variant
    Dim iCount As Integer
    vFileList = Application.GetOpenFilename(MultiSelect:=True)
    If TypeName(vFileList) = "Boolean" Then Exit Sub

    For iCount = 1 To UBound(vFileList)
    Workbooks.Open vFileList(iCount)
    Application.ActiveWindow.Caption = ActiveWorkbook.FullName
    Next

    End Sub
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Adelaide, South Australia, Australia
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Path in Caption (XL2000 SR1)

    Many thanks Jan

Posting Permissions

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