obicauka
05-11-2010, 12:48 PM
Hello Gurus,
Am trying to open a file using the opendialog box. the dialog box opens the folder/file path from a cell that has the path, and when the dialog box opens it should highlight not select the file so i can reconfirm the file before selecting it.
ian_bamforth
05-12-2010, 04:26 AM
Not sure you can do that using the built in methods. You can specify the filename you want to initially be shown in the Filename field (using .InitialFileName). I guess it depends what you want this functionality for - if you're just trying to avoid opening the wrong filename you could just check for the existence of the file before opening the dialog, then pop up a warning if it isn't there?
MarCn
05-12-2010, 11:48 AM
Not sure you can do that using the built in methods. You can specify the filename you want to initially be shown in the Filename field (using .InitialFileName). I guess it depends what you want this functionality for - if you're just trying to avoid opening the wrong filename you could just check for the existence of the file before opening the dialog, then pop up a warning if it isn't there?
Thanks, it's works.
obicauka
05-12-2010, 12:13 PM
Thanks ian,
How can i use the .InitialFileName
ian_bamforth
05-13-2010, 12:56 AM
' Open the file dialog
With Application.FileDialog(msoFileDialogOpen)
' Prevent multiple files being selected
.AllowMultiSelect = False
' Pop up the dialog
.Show
' Set the initial filename to whatever was in the selected cell
' Note that this won't highlight it in the dialog, just puts the text in the "Filename" box
.InitialFileName = ActiveCell.Text
' Handle the Open or Cancel button
.Execute
End With
obicauka
05-13-2010, 10:59 AM
Hi Ian,
thanks 4 replying....
I think you are closer to what i want.
I want it to highlight (point the file) when the dialogbox opens....
any ideas...?
ian_bamforth
05-14-2010, 12:21 AM
As I said in my first post, I don't think you can do that, sorry!