• Path in Caption (XL2000 SR1)

    Author
    Topic
    #360416

    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?

    Viewing 0 reply threads
    Author
    Replies
    • #542709

      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

    Viewing 0 reply threads
    Reply To: Path in Caption (XL2000 SR1)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: