View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
ben ben is offline
external usenet poster
 
Posts: 232
Default How to catch the workbook names...

LJi,

This is directly out of VBA Help

Sub UseFileDialogOpen()

Dim lngCount As Long

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

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

End With

End Sub

The Help files are at times helpfull :)
Ben

--
When you lose your mind, you free your life.


"LJi" wrote:

Hi List,

I am using OpenDialog box to let user open more than one Excel file at
the same time. How can I catch the file names user choosed?

I tried the function Application.GetOpenFilename("Excel Files (*.xls),
*.xls"). But first, it didn't open any file, and secondly, it only
allows user to choose one at a time.

Any help will be appreciated.