+ Reply to Thread
Results 1 to 4 of 4

Closing Excel Instance

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

    Closing Excel Instance

    Hi

    I am Rajesh

    I want to display an Excel file <file.xls> in Internet Explorer 6.0. I am currently displaying the xls file in the browser using javascript code in the click event of a button.

    The problem is that when I close the browser, the excel instance remains in the list of processes in Task Manager.

    Please help me how I can close that instance. Any suggestion or hint will be of great help to me.

    Thanks in Advance
    Rajesh

  2. #2
    Tom Ogilvy
    Guest

    Re: Closing Excel Instance

    This usually is caused by creating a reference to Excel which is not
    released. This can be done by using a construct like

    xlapp.ActiveSheet.Sort Range("A1")

    where the reference to cell A1 is not fully qualified.

    xlApp.Activesheet.Sort xlapp.ActiveSheet.Range("A1")
    would be the proper way to do it.

    If you are only displaying the sheet, then perhaps this is not applicable -
    but you may otherwise not be releasing your reference.

    --
    Regards,
    Tom Ogilvy


    "harkit" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi
    >
    > I am Rajesh
    >
    > I want to display an Excel file <file.xls> in Internet Explorer 6.0. I
    > am currently displaying the xls file in the browser using javascript
    > code in the click event of a button.
    >
    > The problem is that when I close the browser, the excel instance
    > remains in the list of processes in Task Manager.
    >
    > Please help me how I can close that instance. Any suggestion or hint
    > will be of great help to me.
    >
    > 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=391796
    >




  3. #3
    LoodS
    Guest

    RE: Closing Excel Instance

    If you created the Excel instance as an object you have to destroy the object
    when you're done with it. In VBScript it would have been something like "Set
    myApp = Nothing". Hope this helps.
    --
    <vba-programmer>LoodS</vba-programmer>


    "harkit" wrote:

    >
    > Hi
    >
    > I am Rajesh
    >
    > I want to display an Excel file <file.xls> in Internet Explorer 6.0. I
    > am currently displaying the xls file in the browser using javascript
    > code in the click event of a button.
    >
    > The problem is that when I close the browser, the excel instance
    > remains in the list of processes in Task Manager.
    >
    > Please help me how I can close that instance. Any suggestion or hint
    > will be of great help to me.
    >
    > 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=391796
    >
    >


  4. #4
    smr78
    Guest

    Re: Closing Excel Instance



    "Tom Ogilvy" wrote:

    > This usually is caused by creating a reference to Excel which is not
    > released. This can be done by using a construct like
    >
    > xlapp.ActiveSheet.Sort Range("A1")
    >
    > where the reference to cell A1 is not fully qualified.
    >
    > xlApp.Activesheet.Sort xlapp.ActiveSheet.Range("A1")
    > would be the proper way to do it.
    >
    > If you are only displaying the sheet, then perhaps this is not applicable -
    > but you may otherwise not be releasing your reference.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "harkit" <[email protected]> wrote in
    > message news:[email protected]...
    > >
    > > Hi
    > >
    > > I am Rajesh
    > >
    > > I want to display an Excel file <file.xls> in Internet Explorer 6.0. I
    > > am currently displaying the xls file in the browser using javascript
    > > code in the click event of a button.
    > >
    > > The problem is that when I close the browser, the excel instance
    > > remains in the list of processes in Task Manager.
    > >
    > > Please help me how I can close that instance. Any suggestion or hint
    > > will be of great help to me.
    > >
    > > 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=391796
    > >

    Hi,
    You also can try these tips :
    - if your Excel file is displayed in an Frame or Iframe, clean the Frame by
    frame.location="about:blank";
    - try the CollectGarbage method like this (found in an other javascript
    newsgroup post)

    excelapp = new ActiveXObject("Excel.Application");
    ......
    excelapp.workbooks(exlfilenames).Close(); // for all workbooks
    excelapp.Quit();excelapp=null;
    idTmr = window.setInterval("Cleanup();",5);

    function Cleanup() {
    window.clearInterval(idTmr);
    CollectGarbage();
    window.close();
    }
    --------
    Regards

+ 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