Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to return a file name
I would like to import a text file and then reurn its file name into a
text box. I have used this: Application.Dialogs(xlDialogImportTextFile).Show to open a box to import a file... |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to return a file name
I think I'd use something like:
Dim myFileName as variant myfilename = application.getopenfilename("Text files, *.xls") if myfilename = false then exit sub '??? user hit cancel end if msgbox myfilename And if the layout of the input file never changes (always comma delimited or same fixed width layout), the next step would be to open the file using those rules: Workbooks.OpenText Filename:=myFileName, _ StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _ .... I'd record a macro to get the exact details for that .opentext statement. Monte0682 wrote: I would like to import a text file and then reurn its file name into a text box. I have used this: Application.Dialogs(xlDialogImportTextFile).Show to open a box to import a file... -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to return a file name
If the file has been opened and is the active workbook, then
ActiveWorkbook.Name returns its name. If you have a userform where you want to enter that name, then this would set the text box on the form to the name: Userform1.Textbox1.Text = Activeworkbook.name Bob Flanagan Macro Systems http://www.add-ins.com Productivity add-ins and downloadable books on VB macros for Excel "Monte0682" wrote in message ups.com... I would like to import a text file and then reurn its file name into a text box. I have used this: Application.Dialogs(xlDialogImportTextFile).Show to open a box to import a file... |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to return a file name
hello,
my question was: I have a workbook. I would like to import a text file into one of the worksheets...When I go Data, get external data, import text file... To do this I use Application.Dialogs(xlDialogImportTextFile).Show This will import a file, ask for a delimiter... But I would like to export a file name that a opened for later reference... Also I would like to specify into which worksheet I would like to import... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
return excel file by email | New Users to Excel | |||
How to return over saved file? | Excel Discussion (Misc queries) | |||
Return file name only from FileDialog | Excel Programming | |||
Return File Name to cell | Excel Worksheet Functions | |||
Return to Original File | Excel Programming |