converting Excel.Worksheet.Range into ADODB.Recordset

M

Mirco Wilhelm

Hi all,

I'm trying to import an Excel Worksheet Range into an Access Recordset, but
i can't figure out how to handle this type of data.

This copies the values to the clipboard

strExcelRange = "A1:A10"
objExcelSheet.Range(strExcelRange).Copy

and when i paste it to notepad i get this output:

1 a A
2 b B
3 c C
4 d D
5 e E
6 f F
7 g G
8 h H
9 i I
10 j J

All i need to do now is to get these values into a ADODB.Recordset, but i
have to give this output to another data type first, which i haven't figured
out yet.

objExcelSheet.Range(strExcelRange).Copy NewVariable

I tried a String Array, ADODB.Recordset and even a Excel.Range, but
everytime i got the message "Invalid procedure call or argument".

Any Ideas how to do this right?
 
O

onedaywhen

How about:

SELECT *
FROM [MyExcelSheetName$A1:A10]
IN 'C:\MyExcelWorkbook.xls' 'EXCEL 8.0;'
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top