Archive of Mr Excel Message Board
I'm trying to create a macro that (at the end) kicks up an Excel File\Open window.
The idea is that the user can select a specific file (out of several listed in a specific directory) which feeds into a built-in analysis.
Sadly I'm pretty inexperienced VBA wise. My usual method is to record what I can and then tweak the code from there. My attempts at that method this time have failed badly tho.
Does anyone know how to get a macro to kick up the File\Open prompt without actually openning a specific file (I'd like the user to choose)? Any advice would be appreciated.
Thanks all!
Adam

| Check out our Excel VBA Resources | ||||
![]() |
![]() |
![]() |
![]() |
![]() |
You can try ;
filename = Application.GetOpenFilename("Text Files (*.txt), *.txt")
If filename <> False Then
MsgBox "Open " & filename
End If
this is in the Excel online help.

