I'm exporting 10 tab-delimited text files from an Access db and trying to get these 10 files auto imported into one Excel workbook -- each file on a different sheet.
I've tried doing this a couple different ways -- using some ADO recordset code online that didn't work and then trying the "objExcel.Workbooks.OpenText" method.
When I use the following code my first file is added and saved fine:
I cannot use the "OpenText" method again though or it will create a new workbook each time it's used.
I've tried to add another worksheet, make it active and then do the "OpenText" method again but doesn't work.
Does anyone know the best way to import text files into one Excel file but on seperate sheets?
thanks a lot in advance for any help!
I've tried doing this a couple different ways -- using some ADO recordset code online that didn't work and then trying the "objExcel.Workbooks.OpenText" method.
When I use the following code my first file is added and saved fine:
Code:
Dim objExcel As Excel.Application
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.Workbooks.OpenText "E:\DUMP\HEALTH.txt"
objExcel.SaveWorkspace ("E:\DUMP\TEST.xls")
I've tried to add another worksheet, make it active and then do the "OpenText" method again but doesn't work.
Does anyone know the best way to import text files into one Excel file but on seperate sheets?
thanks a lot in advance for any help!