I am using Excel 2003 (11.8211.8202) SP3 which is the American English
version.
Give the code I posted works flawlessly for me, I am not sure what else I
can tell you. Hopefully someone who knows something about possible
differences between international versions will come along and offer their
input.
Rick
"Stefi" wrote in message
...
I did exactly what you wrote, the result (or rather the failure) is the
same.
Can it be affected by some environmental factor (version, any settings,
etc.)? I use Excel2003 SP3 Hungarian version.
Thank you for your efforts!
Regards,
Stefi
€˛Rick Rothstein (MVP - VB)€¯ ezt Ć*rta:
I really don't understand how that could be. I tested the code before
posting it, and I re-tested it just now, and it worked perfectly for me.
All
I did was go to any code window (not the Immediate window though), type
Sub
Test() and End Sub to give it someplace to work from and copy/paste'd the
code between them. When I run the Sub Test(), the file selector window
appeared... I used the Control Key to click-select a few files (although
you
could only select one file if desired) and then clicked the Open
button....
a MsgBox appeared for each file selected showing me its path and name.
The
code works flawlessly for me... every time... so I am not sure what to
tell
you. Is anyone else out there having trouble making the code I posted
work?
Rick
"Stefi" wrote in message
...
Hi Rick,
I tried your code but it gave a "Type mismatch" error at line
For X = LBound(FilesToOpen) To UBound(FilesToOpen)
Locals window displayed the type of FilesToOpen to be Variant/String,
not
an
array as it was expected.
Regards,
Stefi
€˛Rick Rothstein (MVP - VB)€¯ ezt Ć*rta:
Give this code a try...
Dim X As Long
Dim FilesToOpen As Variant
FilesToOpen = Application.GetOpenFilename(MultiSelect:=True)
For X = LBound(FilesToOpen) To UBound(FilesToOpen)
MsgBox "Selected File #" & X & ": " & FilesToOpen(X)
Next
Don't pick too many files as you should get a MsgBox for each one you
select.
Rick
"fallowfz" wrote in message
...
That's what I ran into as well. Thanks for giving it a shot.