As long as you're opening .txt files (well, any plain text file that doesn't
have an extension of .CSV), you should be ok. But VBA treats .CSV files like
comma separated values. Your code is pretty much ignored with .CSV's.
Option Explicit
Sub testme()
Dim myFileName As Variant
Dim wbSource As Workbook
myFileName = Application.GetOpenFilename("Text files, *.txt")
If myFileName = False Then
Exit Sub 'user hit cancel
End If
Workbooks.OpenText Filename:=myFileName, _
Origin:=437, StartRow:=1, DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(10, 1), Array(56, 1), _
Array(58, 2), Array(67, 1), Array(76, 1), Array(85, 1), _
Array(99, 1), Array(109, 1), Array(117, 1)), _
TrailingMinusNumbers:=True
Set wbSource = ActiveWorkbook
'....
End Sub
(I don't like one character variables--personal preference only!)
========
You can even import multiple files (in the same folder). Just click on the
first and ctrl-click on subsequent:
Option Explicit
Sub testme2()
Dim myFileNames As Variant
Dim iCtr As Long
Dim wbSource As Workbook
myFileNames = Application.GetOpenFilename _
(filefilter:="Text files, *.txt", MultiSelect:=True)
If IsArray(myFileNames) Then
'keep going
Else
Exit Sub 'user hit cancel
End If
For iCtr = LBound(myFileNames) To UBound(myFileNames)
Workbooks.OpenText Filename:=myFileNames(iCtr), _
Origin:=437, StartRow:=1, DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(10, 1), Array(56, 1), _
Array(58, 2), Array(67, 1), Array(76, 1), Array(85, 1), _
Array(99, 1), Array(109, 1), Array(117, 1)), _
TrailingMinusNumbers:=True
Set wbSource = ActiveWorkbook
'do more things (copy it elsewhere???)
'maybe even close it without saving
wbSource.Close savechanges:=False
Next iCtr
'....
End Sub