file not visible

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)
 
D

Dave Peterson

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top