Inserting filenames into worksheets with a macro


Posted by dominic ng on January 24, 2002 9:52 AM

Is there an easy way to create a macro that will open a dialog box that will

ask the user to select a file
insert the selected file's filename into the active cell

?

I've been able to 'open' (using Application.Dialogs(xlDialogFindFile).Show) new files but don't know if there is an easy way to use the 'standard windows' file selection form to get this information?



Posted by Mark O'Brien on January 24, 2002 10:09 AM

try this:

ActiveCell.Value = Application.GetOpenFilename