G
Guest
I'm using the following code to get the file name and path, but after the
user click the file, Excel open it.
I don't want the Excel file to open, all I need is to get the file name that
the user selected from the FileDialog box to pass it to excel object:
With
xl.FileDialog(Microsoft.Office.Core.MsoFileDialogType.msoFileDialogFilePicker)
..AllowMultiSelect = False
..Filters.Clear()
..Filters.Add("Excel Files", "*.xls;*.xlw;*.htm;*.html")
If .Show <> 0 Then fileName = .SelectedItems.Item(1)
End With
..... .... .. .
Dim wb As Excel.Workbook = xl.Workbooks.Open(fileName)
...... .... ... ..
do some operation on the file without displaying it to the user .....
how can I do ?
thanks
user click the file, Excel open it.
I don't want the Excel file to open, all I need is to get the file name that
the user selected from the FileDialog box to pass it to excel object:
With
xl.FileDialog(Microsoft.Office.Core.MsoFileDialogType.msoFileDialogFilePicker)
..AllowMultiSelect = False
..Filters.Clear()
..Filters.Add("Excel Files", "*.xls;*.xlw;*.htm;*.html")
If .Show <> 0 Then fileName = .SelectedItems.Item(1)
End With
..... .... .. .
Dim wb As Excel.Workbook = xl.Workbooks.Open(fileName)
...... .... ... ..
do some operation on the file without displaying it to the user .....
how can I do ?
thanks