MrExcel Publishing
Your One Stop for Excel Tips & Solutions

open file


Posted by amroo on April 04, 2001 4:17 AM

Bonjour,
I want to import a file text in a excel spread sheet so, I have an input box whixh ask me to introduce a path (as c:\mydoc\filename.txt) and then clicking on ok the procedure runs.Well if you think that I have to use a listbox or an other tool so do it.
2001 merci
Amroo


Posted by Dave Hawley on April 04, 2001 4:33 AM


How are ya amroo (that's Aussie for Bonjour :o)

This code will use the standard Open dialog box and pass it to the String Variable "MyTextFile". The message box is just to show you the result. I would avoid having the user type a file and path as they WILL mistype it!


Sub TryThis()
Dim MyTextFile as String
MyTextFile = Application.GetOpenFilename
MsgBox MyTextFile
End Sub

See ya!
Dave


OzGrid Business Applications

Posted by amroo on April 04, 2001 11:23 PM

Bonjour to Dave
I put your code in a new macro and make it run, but
I can't get the data of my file text on the spreadsheet.
What's going wrong.
A+ (as see or read you later)
Amroo

Posted by Amroo on April 05, 2001 4:38 AM

Bonjour,
I wrote a code for import a file.text to a spreadsheet after feeling a inputbox with the flie'spath and put it in a macro; it runs very well.
So I put it on the forum if it's need by someone.
Amroo

Posted by Amroo on April 05, 2001 4:38 AM

Bonjour,
I wrote a code for import a file.text to a spreadsheet after feeling a inputbox with the flie'spath and put it in a macro; it runs very well.
So I put it on the forum if it's need by someone.
Amroo