ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   inputbox vs. userform/combobox vs. Windows file handlers ??? (https://www.excelbanter.com/excel-programming/313337-inputbox-vs-userform-combobox-vs-windows-file-handlers.html)

List Lurker

inputbox vs. userform/combobox vs. Windows file handlers ???
 
Hi All:

I need to prompt the user for the name of a secondary workbook, and then
given that "other" filename, use it to replace a "place-holder" filename
in some formulas.

I can do all the search/replace in VBA, and if need by I can use an
INPUTBOX to have the user enter the secondary filename (meaning either
they type it in or copy it from the clipboard).

What would be nice (since filenames are looooong), however, is if I
could present the user w/ some dialboge box that displays all possible
XLS files (having drilled down to some directory, etc.) and then have
the user simply highlight the desired file and presss OK (or something
like that), thus capturing the filename as a VBA variable.

Can that be done easily, or will I have to use standard Window file
diaglogue boxes, etc. and would that mean that the secondary file simply
gets opened vs. capturing its filename as a VBA variable?

Hope the above is clear,

Any help/advice would be much obliged.

Regards




Bob Phillips[_6_]

inputbox vs. userform/combobox vs. Windows file handlers ???
 
List,

Take a look at the GetOpenFilename method in VBA. It presents the file open
dialog box, and the user can select, but it doesn't open it, just returns
the selected filename (full path).

--

HTH

RP

"List Lurker" wrote in message
. ..
Hi All:

I need to prompt the user for the name of a secondary workbook, and then
given that "other" filename, use it to replace a "place-holder" filename
in some formulas.

I can do all the search/replace in VBA, and if need by I can use an
INPUTBOX to have the user enter the secondary filename (meaning either
they type it in or copy it from the clipboard).

What would be nice (since filenames are looooong), however, is if I
could present the user w/ some dialboge box that displays all possible
XLS files (having drilled down to some directory, etc.) and then have
the user simply highlight the desired file and presss OK (or something
like that), thus capturing the filename as a VBA variable.

Can that be done easily, or will I have to use standard Window file
diaglogue boxes, etc. and would that mean that the secondary file simply
gets opened vs. capturing its filename as a VBA variable?

Hope the above is clear,

Any help/advice would be much obliged.

Regards






keepITcool

inputbox vs. userform/combobox vs. Windows file handlers ???
 
if the formulas are linked to external files...
you just have to change the links.

see workbook objects' LinkSources & ChangeLink
Methods to manipulate those.

keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Bob Phillips" wrote:

List,

Take a look at the GetOpenFilename method in VBA. It presents the file
open dialog box, and the user can select, but it doesn't open it, just
returns the selected filename (full path).





All times are GMT +1. The time now is 08:47 AM.

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