ADO.NET with Excel 2003

A

Andre Grumbach

Hi all,
I try to generate a little application to export Data to an excel sheet.

First it looks really nice, because it's write the data to the excel sheet.

But now I have following problem:
I try to write the data to different Cells, e.g. write the first name in
Cell B4, the last name to B5 an so on. The excel I use for this export is
completely empty. So there are no cells initialize.

When I write in cell B4 all the time I get the Error:
The tables contains cells, which are outside the defined Array. (or some
similar, it's an german system [Die Tabelle enthält Zellen, die sich
außerhalb des definierten Bereichs befinden.])

If I write first manual data in cell A4 and A5 there is no problem.
But I could initialize all cells manual, because, it should be an excel
sheet with different pages and a lot of cells and rows.

Is there any way to initialize the cells automatic on insert into the sheet?

Here my query:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + fileName + ";Extended
Properties=\"Excel 8.0;HDR=YES;\""

SELECT * FROM [Tabelle1$A15:B16]
INSERT INTO [Tabelle1$A15:B16] VALUES ('AG', 'EG')

Thanks,
Andre
 

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