Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Open/Import MS Money OFX file into Excel? | Excel Discussion (Misc queries) | |||
How come I can't import an .svc file(Open Office) to Excel file? | Excel Discussion (Misc queries) | |||
How do I import text file, analyze data, export results, open next file | Excel Programming | |||
File-Open import code available anywhere? | Excel Programming | |||
open file dialog-select file-import worksheet | Excel Programming |