appending imported data into access

B

beckyi

When I try to import from an excel spreadsheet everything
works fine but when I try to import another spreadsheet
and want to append the information to an existing table
the option "in an existing table is grayed out, only
option available is "in a new table". How can I get the
existing table to be an option?
 
J

Joe Fallon

Use TransferSpreadsheet - or code like this:

Public Sub ImportSpreadsheet(strTable As String, strFileName As String, _
strWorkSheet As String, strRange As String)
'Purpose: to import a specific sheet and range of a workbook
'Usage: ImportSpreadsheet
"tblExcel","c:\temp\Book1.xls","Sheet1","C5:D7"
'True in the options means the top row are field headers
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel8, _
strTable, strFileName, True, strWorkSheet & "!" & strRange
End Sub
 

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