ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Default Filepath question... How to??? (https://www.excelbanter.com/excel-programming/291086-default-filepath-question-how.html)

blc[_2_]

Default Filepath question... How to???
 
Hello all,

I am working in VB6.0 with the common dialog control and am trying to create some code that will allow me to create/set a default filepath.

Here's what I want to do:

1) I want to bring up the common dialog control and allow the user to select a *FOLDER* (only a folder);

2) I then want to get the filepath to the selected *FOLDER* from the common dialog control,

3) I then want to close the common dialog control and store that *FOLDER* filepath in the windows registry.

The problem is this: How do you get the filepath to the selected folder from the common dialog control *without* actually "opening or saving a file"??? It can't be this hard... What am I doing wrong?!?!?

Thank you in advance,

blc

Ron Dahl[_2_]

Default Filepath question... How to???
 
I tested the following code in an Excel Macro. After the first msgbox of
the folder, the dialog box opened, I moved to another foldere, clicked the
Cancel button, and the second CurDir msgbox showed the revised directory.
Hope this helps.
Ron Dahl

MsgBox CurDir
TheName = Application.GetOpenFilename( _
filefilter:="Excel Files (*.xls), *.xls", _
Title:="Load File")
MsgBox CurDir





"blc" wrote in message
...
Hello all,

I am working in VB6.0 with the common dialog control and am trying to

create some code that will allow me to create/set a default filepath.

Here's what I want to do:

1) I want to bring up the common dialog control and allow the user to

select a *FOLDER* (only a folder);

2) I then want to get the filepath to the selected *FOLDER* from the

common dialog control,

3) I then want to close the common dialog control and store that *FOLDER*

filepath in the windows registry.

The problem is this: How do you get the filepath to the selected folder

from the common dialog control *without* actually "opening or saving a
file"??? It can't be this hard... What am I doing wrong?!?!?

Thank you in advance,

blc





All times are GMT +1. The time now is 05:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com