Hi,
I'm using Microsoft Jet and ADO.NET to insert rows into an excel file, something like this:
Dim SQL as String
SQL = "insert into tabla1 (F1,F2,F3,F4) values('a',1,'b',2)"
cmd.CommandText = SQL
cmd.ExecuteNonQuery()
where tabla1 is a named range in the excel file. But I want to do the same using unnamed ranges, something like this:
SQL = "insert into [Sheet1$A88] (F1,F2,F3,F4) values('a',1,'b',2)"
why? because I want to make inserts of rows with different number of columns, and if I use named ranges it is not possible because I have to define the range previously.
So far, the statement has been working only if I put any value or character in the cells of the range by hand, for example:
A B C D
7
8 c 0 c 0
9
But, the statement doesn't work in ranges with no values in the cells.
Is there any way to do this?
I'll really really really appreciate your help.
Thanks
Jose Carlos
JOSE CARLOS ARAMBURU
josecarloaa@hotmail.com
I'm using Microsoft Jet and ADO.NET to insert rows into an excel file, something like this:
Dim SQL as String
SQL = "insert into tabla1 (F1,F2,F3,F4) values('a',1,'b',2)"
cmd.CommandText = SQL
cmd.ExecuteNonQuery()
where tabla1 is a named range in the excel file. But I want to do the same using unnamed ranges, something like this:
SQL = "insert into [Sheet1$A88] (F1,F2,F3,F4) values('a',1,'b',2)"
why? because I want to make inserts of rows with different number of columns, and if I use named ranges it is not possible because I have to define the range previously.
So far, the statement has been working only if I put any value or character in the cells of the range by hand, for example:
A B C D
7
8 c 0 c 0
9
But, the statement doesn't work in ranges with no values in the cells.
Is there any way to do this?
I'll really really really appreciate your help.
Thanks
Jose Carlos
JOSE CARLOS ARAMBURU
josecarloaa@hotmail.com