Needing some VBA help How do you use the GetOpenFilename met

Needing some VBA help.. How do you use the GetOpenFilename method to navigate to the file and obtain the file name? I am not allowed to open it as a workbook instead I am to open it for import. I then have to use the split method to parse the line of text into an array. and then build a message box that will display all of the words in the text file as a column. I appreciate your help.

Solution

I think It would be help You:-

Sub openFile_with_Name()
Dim f As String, OpenMsg As String, filename As String

f = Application.GetOpenFilename(title:=\"Select Image File\")

\'Exit if cancel is selected
If f = \"False\" Then Exit Sub

\'Find Filename
filename = Dir(f, vbDirectory)
Workbooks.Open filename:=f
MsgBox filename

End Sub

Needing some VBA help.. How do you use the GetOpenFilename method to navigate to the file and obtain the file name? I am not allowed to open it as a workbook in

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site