You may want to have a look here.
****But this requires office2007 format.
Not the 2003 you are trying to do.
It allows you to create an xmlfile to create the spreadsheet.
http://www.vb-tips.com/dbpages.aspx?Search=excel
Miro
"Andre Grumbach" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>