appending imported data into access

  • Thread starter Thread starter beckyi
  • Start date Start date
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?
 
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
 
Back
Top