I am trying to open a text file in a current workbook. The code below is opening the text file but it is creating a new workbook. I want to add a new sheet in the current workbook with the contents in the text fle insteasd of creating a new workbook.
Sub OpenPchFile()
PchFile = Application.GetOpenFilename("Punch Files (*.pch), *.pch")
If PchFile = False Then
MsgBox "Stopping because you did not select a file"
Exit Sub
End If
Workbooks.OpenText Filename:=PchFile, DataType:=xlFixedWidth, startrow:=7, comma:=False
End Sub
Bookmarks