Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Which function to use to open an .asc file?

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to open a 82 KB XLSM file due to "Too many different cellformats" & "Converter failed to open the file." errors. Phillip Pi Excel Discussion (Misc queries) 0 April 23rd 09 08:53 PM
DGET function can't update unless linked file is open Partly Void[_2_] Excel Worksheet Functions 1 August 14th 08 04:14 PM
todays's function, if I open file date changes MaT Excel Discussion (Misc queries) 1 November 22nd 07 07:45 PM
In Excel - Use Windows Explorer instead of File Open to open file KymY Excel Discussion (Misc queries) 1 August 5th 06 09:59 PM
How to insert Open File action in the IF Function? Majesty Excel Discussion (Misc queries) 1 August 23rd 05 03:43 PM


All times are GMT +1. The time now is 01:24 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"