excel open existing .xls and write dotnet

Discussion in 'ASP .Net' started by csgraham74, Feb 1, 2006.

  1. csgraham74

    csgraham74 Guest

    Hi guys,

    just wondering if anyone could - help me work out how to open an
    existing spreadsheet in excel and write to it then save it.

    I have some code that opens a new worksheet everytime but i want to
    just write info to the smae worksheet.

    Thanks
    in advance


    Colin
     
    csgraham74, Feb 1, 2006
    #1
    1. Advertising

  2. You can use OleDbCommand to 'Insert' data to worksheet.

    HTH

    Elton Wang

    "csgraham74" wrote:

    > Hi guys,
    >
    > just wondering if anyone could - help me work out how to open an
    > existing spreadsheet in excel and write to it then save it.
    >
    > I have some code that opens a new worksheet everytime but i want to
    > just write info to the smae worksheet.
    >
    > Thanks
    > in advance
    >
    >
    > Colin
    >
    >
     
    =?Utf-8?B?RWx0b24gVw==?=, Feb 1, 2006
    #2
    1. Advertising

  3. csgraham74

    sloan Guest

    Check
    http://msdn.microsoft.com/library/d...tskCodeExampleReadingExcelDataIntoDataset.asp

    Thats "reading" data into a DataSet, but with the
    OleDbConnection
    you should be able to run an INSERT statement.

    Think of "Sheet1" as a table name. (the bottom tabs at the bottom of the
    excel file)




    "Elton W" <> wrote in message
    news:...
    > You can use OleDbCommand to 'Insert' data to worksheet.
    >
    > HTH
    >
    > Elton Wang
    >
    > "csgraham74" wrote:
    >
    > > Hi guys,
    > >
    > > just wondering if anyone could - help me work out how to open an
    > > existing spreadsheet in excel and write to it then save it.
    > >
    > > I have some code that opens a new worksheet everytime but i want to
    > > just write info to the smae worksheet.
    > >
    > > Thanks
    > > in advance
    > >
    > >
    > > Colin
    > >
    > >
     
    sloan, Feb 2, 2006
    #3
  4. csgraham74

    Guest

    , Feb 2, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Charles A. Lackman
    Replies:
    1
    Views:
    1,403
    smith
    Dec 8, 2004
  2. SpamProof
    Replies:
    0
    Views:
    603
    SpamProof
    Oct 21, 2003
  3. Chuck
    Replies:
    3
    Views:
    529
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Feb 8, 2007
  4. Alfred Sehmueller
    Replies:
    0
    Views:
    274
    Alfred Sehmueller
    Feb 20, 2004
Loading...

Share This Page