Results 1 to 3 of 3

Open different workbook in different path at the listbox

Threaded View

  1. #1
    Registered User
    Join Date
    09-16-2008
    Location
    malaysia
    Posts
    89

    Open different workbook in different path at the listbox

    hi. good days,
    how can i open a different path of the workbook in the listbox. if my listbox there only show the file name.

    
    Private Sub btn_browse_Click()
    Dim FileSelected As Variant
    Dim filename
    Dim FSO As Object
    
    Set FSO = CreateObject("Scripting.FileSystemObject")
    filePathA = Application.GetOpenFilename("Excel Files (*.xls), *.xls")
     
    If filePathA = "False" Then
        filePathA = ""
        Else
        With ListBox1
              .AddItem
                .List(.ListCount - 1, 0) = FSO.GetFileName(filePathA)
                .List(.ListCount - 1, 1) = filePathA
            End With
    
      End If
    End Sub
    if the workbook in different path, it will show the error. please help me. thanks

    
    For Index1 = 0 To ListBox1.ListCount - 1
          Set wbFrom = Workbooks.Open(ListBox1.List(Index1))
               wb1 = ListBox1.List(Index1)
            Next Index1
    Last edited by ccs1981; 11-01-2008 at 12:55 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1