Ranges in TransferSpreadsheet

  • Thread starter Thread starter Don Catanzaro
  • Start date Start date
D

Don Catanzaro

Hi All,

I am writing a bit of code and am transfering a bunch of
MS Excel spreadsheets to Access2000 via
transferspreadsheet.

this snippet works
DoCmd.TransferSpreadsheet acImport, 0, "goo", fileloc,
False, "A33:E33"

But what if I want to transfer A33:C33, D33:E33 ? It
doesn't seem to work.

Any suggestions ?

-Don
 
ACCESS won't support noncontiguous ranges in the TransferSpreadsheet action.

Why not go ahead and use "A33:E33" as the range, import the data into a
temporary table, and then use an append query to copy the desired fields
into the permanent table.

Otherwise, you can use Automation (via VBA code) to open the spreadsheet and
read the cells as you wish and write their values into a recordset that is
based on the destination table.
 
Hi All,

My bad. I meant to say what if I want to transfer a range
like this A33:C33, G33:I33 where you skip some cells in
the middle.
 
See my earlier reply...same for this situation (which is what I assumed you
were using anyway).
 
Back
Top