View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mervb Mervb is offline
external usenet poster
 
Posts: 11
Default How to select a specific file type

I have the following button code - how can I modify it so only a single .cvs
file can be chosen?

Private Sub btnETran_Click()
Dim lngCount As Long

' Open the file dialog
With Application.FileDialog(msoFileDialogOpen)
.AllowMultiSelect = False
.Show

' Display paths of each file selected
For lngCount = 1
MsgBox .SelectedItems(lngCount)
Next lngCount

End With

End Sub

Thanks