file not visible

  • Thread starter Thread starter gw.boswell
  • Start date Start date
G

gw.boswell

In Excel 2003 I wrote a macro that included the below code. This code
opened the file and it was visible. Our company still uses Excel 2002
and the below code does not open the file as visible with this version
of Excel. Is there a quick fix?



Dim objFSO As Object, objTextFile As Object


FileToOpen = Application.GetOpenFilename("NONMEM Table Files (*.prn),
*.prn")

Set objFSO = CreateObject("Scripting.FileSystemObject")

Set objTextFile = objFSO.OpenTextFile(FileToOpen, ForReading)
 
This code does show the File|Open dialog to get the PRN filename from the user.

But the code you shared doesn't show anything else.

So either you didn't share enough of the code (the actual reading and populating
of cells on a worksheet) or maybe you used:

Workbooks.opentext(...)

That would open the text file as a new workbook.
 
Back
Top