John Nurick said:
I don't know what's happening here, Smudger. I've never seen this
message myself and so far can't reproduce it, and the only instance of
it in Google is this here thread.
I've seen similar. Here are some steps to reproduce:
1) Create a new Excel table:
CREATE TABLE
[Excel 8.0;HDR=YES;Database=C:\smudger.xls;].MyNewTable
(MyCol1 FLOAT NULL)
;
2) Create a row of data:
INSERT INTO
[Excel 8.0;HDR=YES;Database=C:\smudger.xls;].MyNewTable
(MyCol1) VALUES (12.34)
;
3) Open the newly-created file in the Excel UI.
4) On the sheet named 'MyNewTable', add the value 56.78 to cell A3.
5) Close and save the workbook.
6) Try inserting another row:
INSERT INTO
[Excel 8.0;HDR=YES;Database=C:\smudger.xls;].MyNewTable
(MyCol1) VALUES (99.99)
;
I get provider error, 'Cannot expand named range'. I'd expect this
too. The CREATE TABLE created an Excel defined Name ('named Range')
for the Range A1:A1. The first successful INSERT INTO expanded the
Range to A1:A2. Manually entering a value in cell A3 prevented the
Name's Range to be expanded any further, that's why the second INSERT
failed.
On the other hand, using the sheet name, rather than the Name name,
will work:
INSERT INTO
[Excel 8.0;HDR=YES;Database=C:\smudger.xls;].[MyNewTable$]
(MyCol1) VALUES (99.99)
;
The above is yet another good reason for not using TransferSpreadsheet
syntax. Never trust a wizard to write sql code <g>.
Jamie.
--