View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Myrna Larson Myrna Larson is offline
external usenet poster
 
Posts: 863
Default Which function to use to open an .asc file?

The Open and OpenText methods of the Workbooks object are probably what you
want. Both methods are described in Help, with examples.

Another way to get the syntax is to turn on the macro recorder and open the
file manually. Then stop the recorder and look at the macro code.


On Fri, 30 Jul 2004 23:32:23 -0400, Real Name wrote:

Hi

Im writing a vba program to take the info from an asc file into
sheet2. I must use the xldelimited so the info goes into each column
properly and not just everything in one column ( it uses the comma to
determine the column).

The intention of the program is, in sheet1, a command button is used
to open a file window. The asc file is then selected bu the user, and
the data is to placed into sheet2. The asc file is no longer needed.
Calculations are made and shown in sheet1 using the data in sheet2.

The problem is Im not sure what function to use. Im thinking this
one:

object.OpenAsTextStream([iomode, [format]])

but cant get the above to work, because not too familiar with vba and
need help. The excel help example doesnt real show me.
Is there a website that has simple examples?

Thanks
Carlos