saban
11-09-2007, 01:25 AM
Private Sub CommandButton1_Click()
Dim fd As FileDialog
Dim luka As Variant
Set fd = Application.FileDialog(msoFileDialogFilePicker)
Dim vrtSelectedItem As Variant
With fd
If .Show = -1 Then
For Each vrtSelectedItem In .SelectedItems
' MsgBox "The path is: " & vrtSelectedItem
'Set files = luka
FileMask_Box = vrtSelectedItem
' files = Application.FileDialog(msoFileDialogOpen).SelectedItems
Next
End If
FileMask_Box.Enabled = False
End With
End Sub
How can I do this:
I will select multiple files (but how do I store all of them in some array) and put them public so when next sub is invoked it does something like:
In Private Sub CommandButton2_Click() I need those values:
fileName = files from CommandButton1_Click
Selectedfiles = files from CommandButton1_Click
So I can do this:
For Each fileName In Selectedfiles
Dim fd As FileDialog
Dim luka As Variant
Set fd = Application.FileDialog(msoFileDialogFilePicker)
Dim vrtSelectedItem As Variant
With fd
If .Show = -1 Then
For Each vrtSelectedItem In .SelectedItems
' MsgBox "The path is: " & vrtSelectedItem
'Set files = luka
FileMask_Box = vrtSelectedItem
' files = Application.FileDialog(msoFileDialogOpen).SelectedItems
Next
End If
FileMask_Box.Enabled = False
End With
End Sub
How can I do this:
I will select multiple files (but how do I store all of them in some array) and put them public so when next sub is invoked it does something like:
In Private Sub CommandButton2_Click() I need those values:
fileName = files from CommandButton1_Click
Selectedfiles = files from CommandButton1_Click
So I can do this:
For Each fileName In Selectedfiles