JoeSchepis
Technical User
Hi,
I am creating an Excel workbook as a template. In this template, I have 6 worksheets defined. This first worksheet is a summary and contains VBA code (not working so well). In this code, I want to select and read in a text file (file extension "DET") and fill in the data into one of the worksheets (the same one each time).
After a Sheets.Select statement to get me on the right sheet, I have used the Application.GetOpenFileName (with the "*.DET" qualifier) to select the file. If I use "Workbooks.Open vFile", I get a new workbook (makes sense). If I use the "With Selection.QueryTable" technique, I am forced into another file open dialog box looking for TXT files. Of course, if I select a DET file that I want, it reads it into the worksheet properly.
Is there any way to place the text contents of vFile (filename.DET) into an exisitng worksheet without having to negotiate file extensions in the Query.Select method?
An example would help this newbie.
Joe
I am creating an Excel workbook as a template. In this template, I have 6 worksheets defined. This first worksheet is a summary and contains VBA code (not working so well). In this code, I want to select and read in a text file (file extension "DET") and fill in the data into one of the worksheets (the same one each time).
After a Sheets.Select statement to get me on the right sheet, I have used the Application.GetOpenFileName (with the "*.DET" qualifier) to select the file. If I use "Workbooks.Open vFile", I get a new workbook (makes sense). If I use the "With Selection.QueryTable" technique, I am forced into another file open dialog box looking for TXT files. Of course, if I select a DET file that I want, it reads it into the worksheet properly.
Is there any way to place the text contents of vFile (filename.DET) into an exisitng worksheet without having to negotiate file extensions in the Query.Select method?
An example would help this newbie.
Joe