+ Reply to Thread
Results 1 to 2 of 2

Saving workbook in code

  1. #1
    Registered User
    Join Date
    08-01-2005
    Posts
    2

    Saving workbook in code

    Hi
    I am Rajesh. I am stuck in a big big problem. PLease help me out...

    I want to open a work book in a xls file using C# code in the page-load event of an ASP.NET page, write two values into two cells (using code), save that workbook and redirect the browser to show that xls file

    But when the workbook.save statement is being executed, a dialog is being thrown at me saying that "A file with name <file1>.xls already exists. Do u want to replace it?"

    1) How can I save that xls file without that dialog?

    And after saving when I redirect the browser to show that xls file, that is becoming a read-only copy. I think this is due to an Excel.exe instance running already in memory.

    2) How can I make that xls file a writable one in when it is displayed in browser?

    Please help me.....

    Many Many thanks in advance
    Rajesh

  2. #2
    Bernie Deitrick
    Guest

    Re: Saving workbook in code

    Rajesh,

    For your question #1, the usual method is to use this before:

    Application.DisplayAlerts = False

    and use this after

    Application.DisplayAlerts = True

    where Application is the Excel object, so change to reflect your actual coding.

    HTH,
    Bernie
    MS Excel MVP


    "harkit" <[email protected]> wrote in message
    news:[email protected]...
    >
    > Hi
    > I am Rajesh. I am stuck in a big big problem. PLease help me out...
    >
    > I want to open a work book in a xls file using C# code in the page-load
    > event of an ASP.NET page, write two values into two cells (using code),
    > save that workbook and redirect the browser to show that xls file
    >
    > But when the workbook.save statement is being executed, a dialog is
    > being thrown at me saying that "A file with name <file1>.xls already
    > exists. Do u want to replace it?"
    >
    > 1) How can I save that xls file without that dialog?
    >
    > And after saving when I redirect the browser to show that xls file,
    > that is becoming a read-only copy. I think this is due to an Excel.exe
    > instance running already in memory.
    >
    > 2) How can I make that xls file a writable one in when it is displayed
    > in browser?
    >
    > Please help me.....
    >
    > Many Many thanks in advance
    > Rajesh
    >
    >
    > --
    > harkit
    > ------------------------------------------------------------------------
    > harkit's Profile: http://www.excelforum.com/member.php...o&userid=25764
    > View this thread: http://www.excelforum.com/showthread...hreadid=391732
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1