Excel doesn't close when running on win 98 / excel 2000


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Excel doesn't close when running on win 98 / excel 2000

Hybrid View

  1. #1
    Elmosca Guest

    Excel doesn't close when running on win 98 / excel 2000

    I've developped an application which imports data from excel. In win XP
    excel XP everithing works ok, but in win 98 excel 2000, the Excel doesnt't
    close after the automation. The code I use:

    'Creating the instance
    Dim xlApplication As Object = CreateObject("Excel.Application")
    xlAplicacion.Visible = False
    Dim xlWorkbook = xlAplicacion.Workbooks.Open(ExcelFile)
    Dim xlSheet= CreateObject("Excel.sheet")
    xlSheet = xlWorkbook.Worksheets("Sheet1")
    '...

    'Closing
    xlSheet = Nothing
    xlWorkbook.Close(False)
    xlWorkbook = Nothing
    xlApplication.Quit()
    xlApplication = Nothing

    If you have the answer, don't hesitate to tell it to me TIA

    Regards,




  2. #2
    Miroslav St. Jeliaskoff Guest

    Re: Excel doesn't close when running on win 98 / excel 2000

    Few messeges down I asked the same question and Phil pointed
    me at

    http://support.microsoft.com/default...B;EN-US;q31710
    9&

    But just to let you know - didn't work for me, so I made some
    big changes is the code and leave the Excel opened all the
    time

    Miroslav St. Jeliaskoff

    "Elmosca" <elmosca@terra.es> wrote in message
    news:3da40f06@10.1.10.29...
    > I've developped an application which imports data from

    excel. In win XP
    > excel XP everithing works ok, but in win 98 excel 2000, the

    Excel doesnt't
    > close after the automation. The code I use:
    >
    > 'Creating the instance
    > Dim xlApplication As Object =

    CreateObject("Excel.Application")
    > xlAplicacion.Visible = False
    > Dim xlWorkbook = xlAplicacion.Workbooks.Open(ExcelFile)
    > Dim xlSheet= CreateObject("Excel.sheet")
    > xlSheet = xlWorkbook.Worksheets("Sheet1")
    > '...
    >
    > 'Closing
    > xlSheet = Nothing
    > xlWorkbook.Close(False)
    > xlWorkbook = Nothing
    > xlApplication.Quit()
    > xlApplication = Nothing
    >
    > If you have the answer, don't hesitate to tell it to me

    TIA
    >
    > Regards,
    >
    >
    >




  3. #3
    Paul Clement Guest

    Re: Excel doesn't close when running on win 98 / excel 2000

    On Wed, 9 Oct 2002 13:38:48 +0200, "Elmosca" <elmosca@terra.es> wrote:

    I've developped an application which imports data from excel. In win XP
    excel XP everithing works ok, but in win 98 excel 2000, the Excel doesnt't
    close after the automation. The code I use:

    'Creating the instance
    Dim xlApplication As Object = CreateObject("Excel.Application")
    xlAplicacion.Visible = False
    Dim xlWorkbook = xlAplicacion.Workbooks.Open(ExcelFile)
    Dim xlSheet= CreateObject("Excel.sheet")
    xlSheet = xlWorkbook.Worksheets("Sheet1")
    '...

    'Closing
    xlSheet = Nothing
    xlWorkbook.Close(False)
    xlWorkbook = Nothing
    xlApplication.Quit()
    xlApplication = Nothing


    One thing is to make certain that you aren't creating any objects implicitly. If you reference an
    Excel object it should be assigned to a variable that you can set to Nothing.

    You can usually narrow this stuff down by selectively commenting more code each time you run it in
    order to isolate what objects are causing Excel to be retained in memory.


    Paul ~~~ pclement@ameritech.net
    Microsoft MVP (Visual Basic)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center