Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GetOpenFilename - Excel 97 and Excel XP

Status
Not open for further replies.

yybd

Mechanical
Apr 15, 2003
1
0
0
US
I have written a large amount of code in Excel 97 VBA that uses the Application.GetOpenFilename command. In 97, I was able to select the files to open in a specific order. In other words, the filenames in the array would be in the order that they were selected in the dialog box.

I have just upgraded to Excel XP and this is no longer the case! No matter what order the files are selected in the dialog box, the array is created in ALPHABETICAL order!

This is bad... very bad - it has pretty much rendered my program useless.

Anyone know of a fix to this (without going back to Excel 97)?
 
Replies continue below

Recommended for you

I don't know of a fix for this, I use a workaround by calling GetOpenFile for a single file select within a DO construct. I add the filename to an array each time the user presses OPEN, and continue the DO until the user presses cancel.

This is okay for a small number of files, not great if you want to select heaps.
 
Status
Not open for further replies.
Back
Top