PDA

View Full Version : Excel open dialog box



obicauka
05-11-2010, 06:11 AM
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.

rbrhodes
05-11-2010, 08:00 PM
Hi obi,

maybe you want to use 'GetOpenFilename' (See VBA Help)

Example:



Dim OpenFileName as String

OpenFileName = Application.GetOpenFilename("My Files" (*.xlsm), *.xlsm")
'Check if cancelled
If OpenFileName <> "False" Then

'do something here

End if

'//OR

'Check if cancelled
If OpenFileName = "False" Then Exit Sub