View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Helge Arntsen Helge Arntsen is offline
external usenet poster
 
Posts: 1
Default copy Excel worksheets into one text file

Hi
I want to create a job for copying all data from one
excel file containing many worksheets into only one text
file.

I have been experimenting with using Import Wizard in SQL
Server to create a Transform Data Task in DTS. This is
working, but my problem is that the Excel file contains
several worksheets. I want to repeat the procedure for
each worksheet, but I do not want one text file for each
worksheet. I want one text file containing data from all
the worksheets. The problem is that my text file is
emptied each time I execute the job, so I am not able to
add data to the existing text file. There are about
20000 rows in each worksheet, so I do not want to end up
using a solution that gives slow performance.

I have an alternative solution using Excel macros, and
this contains:

Open TextFile For Output As 1
Print #1
Loop

This will print one by one row to the text file.
I think I can make this work, but my question is:
Is there a better way to do this in Excel macros, in
command prompt, VBS, DTS?

Best regards
Helge Arntsen