Hello all,
XPsp3
I have the need to select a file, and found "BrowseFolFolder" should be able to do it.
The problem is that no matter the path or the file selected, all I get is a "The system cannot find the file specified" error.
The stripped-down example :
- - - - - - - - - - - - - -
Set shell = CreateObject("Shell.Application")
call shell.BrowseForFolder(0, "Choose a file:", &H4000, "c:\")
- - - - - - - - - - - - - -
I do not see what might be going wrong here. Help ?
Regards,
Rudy Wieser
When presented with your code, CoPilot sez:
This code selects a folder.
Set shell = CreateObject("Shell.Application")
Set folder = shell.BrowseForFolder(0, "Choose a folder:", &H4000, "c:\")
This code selects a file. We'll see in a moment, what the Copilot is up
to.
Set dialog = CreateObject("UserAccounts.CommonDialog")
dialog.Filter = "All Files|*.*"
dialog.FilterIndex = 1
dialog.InitialDir = "C:\"
dialog.ShowOpen
Hello all,
XPsp3
I have the need to select a file, and found "BrowseFolFolder" should be able to do it.
The problem is that no matter the path or the file selected, all I get is a "The system cannot find the file specified" error.
The stripped-down example :
- - - - - - - - - - - - - -
Set shell = CreateObject("Shell.Application")
call shell.BrowseForFolder(0, "Choose a file:", &H4000, "c:\")
- - - - - - - - - - - - - -
I do not see what might be going wrong here. Help ?
Regards,
Rudy Wieser
On 12/16/2025 2:26 AM, R.Wieser wrote:
Hello all,
XPsp3
I have the need to select a file, and found "BrowseFolFolder" should be able
to do it.
The problem is that no matter the path or the file selected, all I get is a >> "The system cannot find the file specified" error.
The stripped-down example :
- - - - - - - - - - - - - -
Set shell = CreateObject("Shell.Application")
call shell.BrowseForFolder(0, "Choose a file:", &H4000, "c:\")
- - - - - - - - - - - - - -
I do not see what might be going wrong here. Help ?
Regards,
Rudy Wieser
Creating your own script is like creating the wheel when it already
exists. Instead, try the Everything application from <https://www.voidtools.com/>.
Creating your own script is like creating the wheel when it already
exists.
Hello all,
XPsp3
I have the need to select a file, and found "BrowseFolFolder" should be able to do it.
The problem is that no matter the path or the file selected, all I get is a "The system cannot find the file specified" error.
The stripped-down example :
- - - - - - - - - - - - - -
Set shell = CreateObject("Shell.Application")
call shell.BrowseForFolder(0, "Choose a file:", &H4000, "c:\")
- - - - - - - - - - - - - -
I do not see what might be going wrong here. Help ?
Are you sure the error occurs within that two lines?
Did the dialog manage to be shown in the first place?
Did it occur during the file selection while the dialog is shown?
Did it occur after pressing the OK button?
Did BrowseForFolder manage to return at all?
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 54 |
| Nodes: | 6 (1 / 5) |
| Uptime: | 21:00:02 |
| Calls: | 742 |
| Files: | 1,218 |
| D/L today: |
6 files (8,794K bytes) |
| Messages: | 185,811 |
| Posted today: | 1 |