Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default Let user choose multiple files?

I am looking for an easy way to let users choose
multiple files all at once. Is the built-in FileDialog()
function my only choice?? I am curious if there are other
options for letting users drag and drop multiple files into a
form or dialog box??

Please let me know. Thanks!

Robert.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default Let user choose multiple files?

hi Robert,

Sub sDialogFilePicker()
Dim fd As FileDialog
Dim oFile As String

Dim sFileName As String

Set fd = Application.FileDialog(msoFileDialogFilePicker)

With fd
.AllowMultiSelect = True
.Show

On Error Resume Next
If Err.Number < 0 Then Err.Clear: Exit Sub


For i = 1 To .SelectedItems.Count
Debug.Print .SelectedItems(i)
Next

End With
End Sub

isabelle


Le 2013-01-30 03:07, Robert Crandal a écrit :
I am looking for an easy way to let users choose
multiple files all at once. Is the built-in FileDialog()
function my only choice?? I am curious if there are other
options for letting users drag and drop multiple files into a
form or dialog box??

Please let me know. Thanks!

Robert.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default Let user choose multiple files?

Thank you Isabelle. You're always very helpful! 8)


"isabelle" wrote in message ...
hi Robert,

Sub sDialogFilePicker()
Dim fd As FileDialog
Dim oFile As String

Dim sFileName As String

Set fd = Application.FileDialog(msoFileDialogFilePicker)

With fd
.AllowMultiSelect = True
.Show

On Error Resume Next
If Err.Number < 0 Then Err.Clear: Exit Sub


For i = 1 To .SelectedItems.Count
Debug.Print .SelectedItems(i)
Next

End With
End Sub

isabelle


Le 2013-01-30 03:07, Robert Crandal a écrit :
I am looking for an easy way to let users choose
multiple files all at once. Is the built-in FileDialog()
function my only choice?? I am curious if there are other
options for letting users drag and drop multiple files into a
form or dialog box??

Please let me know. Thanks!

Robert.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 829
Default Let user choose multiple files?

"Robert Crandal" wrote:
I am looking for an easy way to let users choose
multiple files all at once.


I do it this way.

Dim fnames As Variant
fnames = Application.GetOpenFilename(MultiSelect:=True)
If TypeName(fnames) = "Boolean" Then Exit Sub
For i = 1 To UBound(fnames)
Debug.Print fnames(i)
Next i
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Let a user choose a folder? Robert Crandal[_2_] Excel Programming 3 December 25th 10 07:25 PM
dropdownlist- I want user to choose a # but can I add definition Chopchop Excel Discussion (Misc queries) 6 June 23rd 05 09:16 PM
User Input to open multiple files Mike D.[_2_] Excel Programming 2 November 16th 04 09:32 AM
ask user to choose Sam Excel Programming 0 September 23rd 03 01:43 PM
ask user to choose Sam Excel Programming 0 September 23rd 03 12:53 PM


All times are GMT +1. The time now is 05:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"