import several sheets at once

lipin

Registered User.
Local time
Today, 20:11
Joined
May 21, 2002
Messages
149
I have an excel file with employee records. THere is a worksheet for each month. Well I can import into the table fine, but I was wondering how to import all the pages of a workbook into my table. All sheets have same fields. How can I avoid importing each sheet 1 at a time.
Thanks
 
As long as the spreadsheets always have the same number of wheets with the same names, you can just set up a TransferSpreadsheet Method for each sheet. Otherwise, I think you'll need to use OLE and write some code to do the import.
 
to Pat:

You have code for importing several ole objects?? more please

I've got table full of roots to .bmp files as a text field
and another field as OLE where I hope to embed the pics

need code to loop thru roots to files and embed each pic into a record -

sri to butt in on Excel discussion but perhaps same principle?
 
Sorry, if I had had a code sample, I would have posted it.
 
Start with something like this...

Code:
Set obXLS = CreateObject("Excel.Application")   'get the spreadsheet
obXLS.Visible = False           'make it invisible
obXLS.Workbooks.Open _
    Filename:=stInputFile, _
    ReadOnly:=True                  'open this file
obXLS.Workbooks(1).Activate         'open the workbook

Once you have this open, you can do a loop on

obXLS.Workbooks(1).Worksheets.Count from 1 to the count, where you generate the transferspreadsheet method.
 

Users who are viewing this thread

Back
Top Bottom