Re: importing named ranges in Excel into tables in Access - how to

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



You can't link an external data source to an existing table. Link the
spreadsheet as a table with a name of its own, and then construct an
append query (in the normal Access way, not using the special syntax I
describe in my other post) to move the data into your existing table.

On Thu, 19 Oct 2006 15:15:03 -0700, TechyTemp
<TechyTemp@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

John,

I have tried to link the spreadsheet in Excel which I just created today to
the Customer table in Access and am told that Access can't overwrite the
table. Why would this be?

"TechyTemp" wrote:

John,

I've never done this before and the directions you've given me don't look
the same as the book I have (Access 2002 Bible). I don't see any examples of
straight syntax used. Would you mind walking me thru this in a little more
detail? I'm confused.

"John Nurick" wrote:

PMFJI,

If it's a question of importing selected, non-contiguous columns from a
contiguous rectangular range, you can either

1) link or import the entire range to a temporary table, and use an
append query to select the data from the desired columns and insert it
into the table where you need it.

2) use an append query that links directly to the contiguous range with
syntax like these examples:

INSERT INTO MyExistingTable
SELECT Field1, Field3, Field5
FROM [Excel 8.0;HDR=Yes;database=C:\Book.xls;].[RangeName]
;

INSERT INTO MyExistingTable
SELECT F1 As Field1, F3 AS NextField, F5 AS OtherField
FROM [Excel 8.0;HDR=No;database=C:\Book.xls;].[Sheet1$A1:E100]
;


On Tue, 17 Oct 2006 08:58:02 -0700, TechyTemp
<TechyTemp@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Van T. Dinh,

No. The ranges aren't contiguous. Does that mean I need to use another
method such as an append query? Would that work? If so, how would I write
the syntax? I've never done anything that advanced before. Could you walk
me thru that?

"Van T. Dinh" wrote:

Are your Excel ranges contiguous?

IIRC, Access can only recognise contiguous ranges from Excel ...

--
HTH
Van T. Dinh
MVP (Access)



"TechyTemp" <TechyTemp@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:47913791-F3E9-43D7-BC50-2E7468D7A9D0@xxxxxxxxxxxxxxxx
I have set up named ranges in Excel which correspond to tables in Access
and
used the file/get external data/import feature in Access. When I select
the
named ranges option my ranges don't appear in the selection box. What am
I
doing wrong and/or is there another way to import the data from excel to
access?




--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.


--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
.



Relevant Pages

  • Re: importing named ranges in Excel into tables in Access - how to
    ... append query to select the data from the desired columns and insert it ... use an append query that links directly to the contiguous range with ... Access can only recognise contiguous ranges from Excel ... ...
    (microsoft.public.access.externaldata)
  • Re: importing named ranges in Excel into tables in Access - how to
    ... I've never done this before and the directions you've given me don't look ... append query to select the data from the desired columns and insert it ... use an append query that links directly to the contiguous range with ... Access can only recognise contiguous ranges from Excel ... ...
    (microsoft.public.access.externaldata)
  • Re: Top Ten rules for using Sumproduct ?
    ... > Rule 1 All ranges within sumproduct function must be the same size. ... If you are inclined to use the 'native' syntax of SumProduct, ... If the refs are of the same shape, invoke ...
    (microsoft.public.excel.misc)
  • nvi strangeness
    ... the ex/vi command for regexp substitution is ... Assuming the syntax is the same as for ed / sed, ... I would really like nvi to understand ed-like ranges, ... I wonder why the nvi license is reproduced in ...
    (freebsd-hackers)
  • Re: nvi strangeness
    ... Assuming the syntax is the same as for ed / sed, ... replace every occurrence of the word wait with the word delta: ... I would really like nvi to understand ed-like ranges, ... I wonder why the nvi license is reproduced in ...
    (freebsd-hackers)