Unfortunately, the Set openDialog = CreateObject("MSComDlg.CommonDialog line results in an "ActiveX component can't create object" error. Your suggested link, however, got me looking at some other sites and I came pretty close to getting it. Close but no cigar. There's a function of the Shell.Application called BrowseForFolder which throws up an explorer dialog window and allows me to navigate through the directory structure. However, as the name implies, it seems to only allow me to get a specific folder or full path name and not a file name which is what i want. I've tested the following code attempting to select both a folder and a file.
Set oShell = CreateObject("Shell.Application")
Set oItem = oShell.BrowseForFolder(&H0, "Navigate to and select the baseline file for comparison", &H4000)
If Not (oItem is Nothing) Then
Log.Message oItem.Title
Log.Message oItem.self.path
Else
Log.Message "oItem is nothing"
End If
When I select a folder the log contains two messages. The Title returns just the folder name that was selected. The self.path returns the whole pathname with the selected folder being the rightmost value. when i select a file within a folder, the log is empty. no log messages at all. Supposedly, according to the documentation i found online, putting the &H4000 value as the third parameter of BrowseForFolder is intended to include filenames:
WINDOW_OPTIONS
Const BIF_RETURNONLYFSDIRS = &H0001 (The default)
Const BIF_DONTGOBELOWDOMAIN = &H0002
Const BIF_STATUSTEXT = &H0004
Const BIF_RETURNFSANCESTORS = &H0008
Const BIF_EDITBOX = &H0010
Const BIF_VALIDATE = &H0020
Const BIF_NONEWFOLDER = &H0200
Const BIF_BROWSEFORCOMPUTER = &H1000
Const BIF_BROWSEFORPRINTER = &H2000
Const BIF_BROWSEINCLUDEFILES = &H4000
Apparently, it only displays the files in the filedialog but won't return it from the function. Why display them if you can't pick them? It doesn't look as though Shell.Application has a BrowseForFiles function so I'm still out of luck. I haven't tried Martin's suggestion about the UserForm yet. I would really prefer something along this line of just code. If you have any idea why I got the error with the Set openDialog = CreateObject("MSComDlg.CommonDialog please let me know. that sounded like just what the doctor ordered.
Thanks