J
Joanne
using winxp and msoffice 2003
I am trying to open a file using the onclick event in my listbox.
But all I am capturing is the index number of the file and not the file
name that is actually the item in the list. So when the directory is
opened and searched for the file, it cannot locate the file because the
filename is not the same as the listbox index number.
Here is the routine I am using.
Private Sub lbVendor_Click()
Dim fname As String
fname = lbVendor.ListIndex
ChDir "C:\TestDir\Matt-House"
Workbooks.Open fname
End Sub
Could you tell me how to catch the actual filename as it is listed in
the listbox?
Thanks
Joanne
I am trying to open a file using the onclick event in my listbox.
But all I am capturing is the index number of the file and not the file
name that is actually the item in the list. So when the directory is
opened and searched for the file, it cannot locate the file because the
filename is not the same as the listbox index number.
Here is the routine I am using.
Private Sub lbVendor_Click()
Dim fname As String
fname = lbVendor.ListIndex
ChDir "C:\TestDir\Matt-House"
Workbooks.Open fname
End Sub
Could you tell me how to catch the actual filename as it is listed in
the listbox?
Thanks
Joanne