Hi
This is my first question on this forum. I am also rather new at VBA.
I want to catch the name of the file that is chosen by the dialog popup window using this line of code:
"RetVal = Application.Dialogs(xlDialogOpen).Show("*.txt")"
As I have interpreted it filter the directory so only teextfiles are seen.
RetVal variable returns a Boolean, which is just used to see if the user is actually picking a file or just click cancel.
The original code in itself is not written by me, I just want to update it to display the particular file name that is chosen in a specific cell in the Excell workbook i.e. A1.
For the moment I just want to catch the name of the file that the user is clicking on when message box comes up.
Is there an extension to the code line above or do I need to rewritten the whole code to first catch the filename and then do the rest of the code?
Tanks ahead
This is my first question on this forum. I am also rather new at VBA.
I want to catch the name of the file that is chosen by the dialog popup window using this line of code:
"RetVal = Application.Dialogs(xlDialogOpen).Show("*.txt")"
As I have interpreted it filter the directory so only teextfiles are seen.
RetVal variable returns a Boolean, which is just used to see if the user is actually picking a file or just click cancel.
The original code in itself is not written by me, I just want to update it to display the particular file name that is chosen in a specific cell in the Excell workbook i.e. A1.
For the moment I just want to catch the name of the file that the user is clicking on when message box comes up.
Is there an extension to the code line above or do I need to rewritten the whole code to first catch the filename and then do the rest of the code?
Tanks ahead