Import Excel Spreadsheet into Access

G

Guest

Hello,

I need to upload 2 spreadsheets from an Excel Workbook containing 10
worksheets. The information on these 2 spreadsheets are in form format, and
not all of it needs to be added to the database.

How can I map and automate an import process, so that I can translate the
data on specific cells (A1 = Client.FName, B2 = Client.LName) into the
appropriate tables in Access?

Any help would be much appreciated.

Thanks
 
G

Guest

You had better be good in VBA to do this. You will have to use automation to
open the workbook, select the worksheet, and copy the value of the cells you
want. The topic is too complex to address here, I would suggest some
research on the subject. Here is some sample code excerpts I use to create a
spreadsheet. Reading from it is pretty much the same.

Set xlApp = New Excel.Application
Set xlBook = xlApp.Workbooks.Add
xlBook.Activate
xlBook.Worksheets(xlBook.Worksheets.Count).Activate
Set xlSheet = xlBook.ActiveSheet

With xlSheet
.Cells(30, 2).Formula = "=+B29"
.Cells(30, 3).Formula = "=+B30+C29"
.Cells(30, 4).Formula = "=+C30+D29"
.Cells(30, 5).Formula = "=+D30+E29"
.Cells(30, 6).Formula = "=+E30+F29"
.Cells(30, 7).Formula = "=+F30+G29"
.Cells(30, 8).Formula = "=+G30+H29"
.Cells(30, 9).Formula = "=+H30+I29"
.Cells(30, 10).Formula = "=+I30+J29"
.Cells(30, 11).Formula = "=+J30+K29"
.Cells(30, 12).Formula = "=+K30+L29"
.Cells(30, 13).Formula = "=+L30+M29"
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top