S
scott g
Someone was helping me last week and gave me this nifty
little script but I cant get it to work. I keep getting
errors..when I run it, its asking for a value for RefID,
Surname and I am not sure why...those are my column
names...then I get an error saying unrecognized database
format.....I took off the excel 8.0 and got the same error
I am using excel 97 and access 97
I am totally lost now.
Here is the script
You can use an INSERT INTO query.
For example, if in your Excel workbook you had a worksheet
called
Sheet1 and cells E3=RefID and F3=Surname (i.e. column
headings) then
the following query would work:
INSERT INTO
[Sheet1$E3:F4]
IN 'C:\MyWorkbook.xls' 'EXCEL 8.0;'
SELECT
RefID, Surname
FROM MyTable
You don't have to be that precise with the cell address in
the SQL
string. This would also work for the same worksheet:
INSERT INTO
[Sheet1$A1:IV65536]
IN 'C:\MyWorkbook.xls' 'EXCEL 8.0;'
SELECT
RefID, Surname
FROM MyTable
Thanks
scott
little script but I cant get it to work. I keep getting
errors..when I run it, its asking for a value for RefID,
Surname and I am not sure why...those are my column
names...then I get an error saying unrecognized database
format.....I took off the excel 8.0 and got the same error
I am using excel 97 and access 97
I am totally lost now.
Here is the script
You can use an INSERT INTO query.
For example, if in your Excel workbook you had a worksheet
called
Sheet1 and cells E3=RefID and F3=Surname (i.e. column
headings) then
the following query would work:
INSERT INTO
[Sheet1$E3:F4]
IN 'C:\MyWorkbook.xls' 'EXCEL 8.0;'
SELECT
RefID, Surname
FROM MyTable
You don't have to be that precise with the cell address in
the SQL
string. This would also work for the same worksheet:
INSERT INTO
[Sheet1$A1:IV65536]
IN 'C:\MyWorkbook.xls' 'EXCEL 8.0;'
SELECT
RefID, Surname
FROM MyTable
Thanks
scott