View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default GetOpenFilename With MultiSelect Intermittently Returns String

Sure enough, I came back to work on Monday and I am getting the error
again.
So you are probably right.


I also think Greg is right, an Isformula CF that includes a worksheet
function the culprit, same with app.Inputbox type 8.

The FileDialog property appears to work in
exactly the same manner as GetOpenFilename,


Good idea but bear in mind it needs XL2002 or later.

Regards,
Peter T


"Lazzaroni" wrote in message
...
Greg:

Sure enough, I came back to work on Monday and I am getting the error

again.
So you are probably right.

Fortunately, I think I may have found an even better alternative.

In all my searching about the GetOpenFilename method nobody ever suggested
using the FileDialog property. The FileDialog property appears to work in
exactly the same manner as GetOpenFilename, but has even more flexibility.

Dim oFileDialog As FileDialog
Dim oSelectedItem As Variant
Set oFileDialog = Application.FileDialog(msoFileDialogFilePicker)
oFileDialog.AllowMultiSelect = True
If oFileDialog.Show = -1 Then
For Each oSelectedItem In oFileDialog.SelectedItems
MsgBox "Selected item's path: " & oSelectedItem
Next
End If
End With
Set oFileDialog = Nothing

I can only hope that the FileDialog property does not experience the same
problem as GetOpenFilename.

Thanks for your help.