Re: Access Bug??
From: Luis (anonymous_at_discussions.microsoft.com)
Date: 08/26/04
- Next message: Luis: "Combo box populate"
- Previous message: Paul Smith: "Re: Access Crashes with CONTAINS in ServerFilter"
- In reply to: Ken Snell [MVP]: "Re: Access Bug??"
- Next in thread: Ken Snell [MVP]: "Re: Access Bug??"
- Reply: Ken Snell [MVP]: "Re: Access Bug??"
- Reply: Dan Artuso: "Re: Access Bug??"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 26 Aug 2004 07:54:55 -0700
Ken, I've tryied to change this but the process still
remains. It doesn't "kill" the process.
>-----Original Message-----
>You're using ActiveWorkbook, which creates a new
reference to the open
>workbook. As such, because you don't "set it to nothing",
it keeps Excel
>open.
>
>Change this line:
> wbxl.ActiveWorkbook.Close savechanges:=False
>
>to this:
> wbxl.Workbooks(1).Close savechanges:=False
>
>--
>
> Ken Snell
><MS ACCESS MVP>
>
>"Luis" <anonymous@discussions.microsoft.com> wrote in
message
>news:077e01c48b4e$2e367f90$a301280a@phx.gbl...
>> Hello.
>> I have a module that creates 2 different Excel
application
>> objects. I create one object, process the object and do
>> set Wbxl=Nothing. I repeat the same process to the
second
>> object.
>> The big problem is that only one of the objects is
killed.
>> If i go to Windows Task Manager there is still one
>> Excel.Exe process. This causes that when i close the
>> database I get an Excel exception error.
>> Is it an Access bug or am i doing something wrong? The
>> code i'm using looks like this:
>>
>> Public Function Process_cell()
>> Dim wbxl As Object
>> Dim wbxl2 As Object
>>
>> Set wbxl = CreateObject("Excel.application")
>> Path = "mypath"
>> wbxl.DisplayAlerts = False
>> wbxl.Workbooks.Open Path
>> DoCmd.TransferSpread*** acImport,
>> acSpreadsheetTypeExcel9, "mytable1", "Path",
>> True, "A2:IV65536"
>> wbxl.ActiveWorkbook.Close savechanges:=False
>> wbxl.Quit
>> Set wbxl = Nothing
>>
>>
>> Set wbxl2 = CreateObject("Excel.application")
>> Path = "mypath2"
>> wbxl2.DisplayAlerts = False
>> wbxl2.Workbooks.Open Path
>> DoCmd.TransferSpread*** acImport,
>> acSpreadsheetTypeExcel9, "mytable2", "Path",
>> True, "A2:IV65536"
>> wbxl2.ActiveWorkbook.Close savechanges:=False
>> wbxl2.Quit
>> Set wbxl2 = Nothing
>> End Function
>
>
>.
>
- Next message: Luis: "Combo box populate"
- Previous message: Paul Smith: "Re: Access Crashes with CONTAINS in ServerFilter"
- In reply to: Ken Snell [MVP]: "Re: Access Bug??"
- Next in thread: Ken Snell [MVP]: "Re: Access Bug??"
- Reply: Ken Snell [MVP]: "Re: Access Bug??"
- Reply: Dan Artuso: "Re: Access Bug??"
- Messages sorted by: [ date ] [ thread ]