This is an old thread, but it seems like the best place to post some new info. Our machine controller is running XP, but I just upgraded to a new Windows 7 machine for development. Under XP, I've been using the following incantation to create a file dialog:
Set ObjFSO = CreateObject("UserAccounts.CommonDialog")
ObjFSO.Filter = "Text Documents|*.txt"
ObjFSO.FilterIndex = 1
ObjFSO.InitialDir = "c:\PCNC3\Nagahara\MeasureKeys"
InitFSO = ObjFSO.ShowOpen
If InitFSO = False Then
Exit Sub
End If
PathName = ObjFSO.FileName
Apparently there are security issues with this approach and Microsoft has done away with it in Vista and Win7. Searching the web, I found
several different approaches that people have come up with to present a file dialog. IMO the cleanest and most portable is
here. After installing this new dll on XP and Win7, the following code works under both operating systems to display a file dialog:
Set jsS = CreateObject("jsShell.Ops")
sFile = jsS.OpenDlg("Select file.", "txt", ""c:\PCNC3\Nagahara\MeasureKeys")
---
David