I would like to know how to close a workbook without knowing what the name is. Users download files from the server and I don't know what the name is.
I tried
but it doesn't work.
The following is what is used to open the file.
Code
ChDrive "h"
ChDir ("h:\mk\download")
fname = Application.GetOpenFilename("text files(*.txt),*.txt")
If fname <> False Then
Workbooks.OpenText Filename:=fname, Origin:= _
xlWindows, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array(Array(0, _
1), Array(7, 1), Array(73, 1), Array(91, 1), Array(109, 1), Array(127, 1))
End If
Display More
Thanks,
Daniel