ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   NONE (https://www.excelbanter.com/excel-programming/273104-re-none.html)

steve

NONE
 
bw,

Dim TheFileName

ChDir "c:\"
TheFileName = Application.GetOpenFilename("Text Files (*.txt), *.txt")

Use ChDir "c:\folder1\folder2"
to get to a particular folder

steve

"bw" wrote in message
...
I have the following two statements (among others, of course):

TheFileName = Application.GetOpenFilename("Text Files (*.txt), *.txt")

Workbooks.OpenText Filename:=TheFileName, Origin:=xlWindows, _
StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=myArray

I would like the default directory to begin looking in to be C:\

I have tried the following with no success:

TheFileName = Application.GetOpenFilename("Text Files (*.txt),

C:\.txt")

Thanks,
Bernie






All times are GMT +1. The time now is 10:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com