Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default How to Open txt File and Import it to excel

Hi,

How can I do the following usig VC++ 6.0 SP5 on Excel 2002 ?
The steps I manually perform are as follows. These are the steps I would
like to automate.

1) Launch Excel application
2) File- Open- select/choose a text file.
3) Import into excel - start importing from row 2
4) Set de-limiters for space/tab...etc
5) Run Macro
6) Graph results
7) Save the excel file as a workbook as somename.xls
8) Close the workbook ( which has only one worksheet )
9) Repeat the steps for different files.

I can successfully launch the excel app from my C++ code, which is a direct
rip-off from KB article. I can also launch a FileOpen dialog box. But Im
stuck here. I dont know how to read in the file name. Even if I assume, I can
supply the file names before hand and compile the project, how can I achieve
the rest ?

To elaborate
Say, I have a file a1.txt I need to first do an import into excel, then run
a macro, graph, save as a1.xls or any such name, and close the workbook. and
then open a2.txt , start over again!

Thanks,
Ps: My main problem, is I cant seem to fnid the documentation of the methods
for classes such as _Application, _Workbok..etctec

Deepak

  #2   Report Post  
Posted to microsoft.public.excel.programming
M H M H is offline
external usenet poster
 
Posts: 28
Default How to Open txt File and Import it to excel

Hi Deepak,

I'm not trying to offer a solution but I have the very similar issue to
address. Just have posted a request recently titled "automated file
loading and saving". I have only a little clue, but far from getting it
done. It would be much appreciated if you've already got yours done.

rgds,
Maurice

*** Sent via Developersdex http://www.developersdex.com ***
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
Open/Import MS Money OFX file into Excel? Joe User[_2_] Excel Discussion (Misc queries) 3 January 29th 10 11:38 PM
How come I can't import an .svc file(Open Office) to Excel file? beezer Excel Discussion (Misc queries) 1 August 28th 06 12:05 AM
How do I import text file, analyze data, export results, open next file Geoffro Excel Programming 2 March 6th 05 08:02 PM
File-Open import code available anywhere? Pal Excel Programming 0 February 27th 04 11:40 PM
open file dialog-select file-import worksheet Divinedar Excel Programming 1 January 16th 04 07:13 PM


All times are GMT +1. The time now is 08:40 PM.

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"