-
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,
-
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,
>
>
>
-
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
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks