Dear all,
I want to open a text file with following but it doesn't work. Please help to point out.
Thanks,
Linda
I want to open a text file with following but it doesn't work. Please help to point out.
VBA Code:
Dim Ag as Variant
Ag = Format (Cells(2,4), "YYYY-MM-DD")
ChDir: "T:\TEMP\Stock Closing Pr\backup\2024\Ag"
Workbooks.OpenText Filename:_
"T:\TEMP\Stock Closing Pr\backup\2024\" & Ag & "\CTFCLOSPRIC",Origin:=950, StartRow:=1, DataType:=x1FixdWidth, FieldInfo:= Array(0,1), Array(1,1), Array(5,1), TrailingMinusNumbers:= True
Thanks,
Linda