Página 1 de 2
Can't terminate Excel oleobject
Publicado: Vie Jul 20, 2007 2:21 pm
por Gejza Horvath
HI,
I use the next code:
oExcel := CREATEOBJECT( "Excel.Application" )
oWorkBook := oExcel:WorkBooks:Add( )
oSheet := oExcel:Get( "ActiveSheet" )
.
.
Some code to fill the sheet
.
oWorkBook:Close(.T.)
oExcel:Quit()
The last line should terminate Excel, but it's runnig, listed in TaskManager. At this
moment it is unable to run any other instances of excel, until kill it in TM. Any idea?
Gejza Horváth
Can't terminate Excel oleobject
Publicado: Vie Jul 20, 2007 3:08 pm
por jfgimenez
Gejza,
> I use the next code:
> oExcel := CREATEOBJECT( "Excel.Application" )
> oWorkBook := oExcel:WorkBooks:Add( )
> oSheet := oExcel:Get( "ActiveSheet" )
> .
> .
> Some code to fill the sheet
> .
> oWorkBook:Close(.T.)
>
> oExcel:Quit()
>
> The last line should terminate Excel, but it's runnig, listed in
> TaskManager. At this moment it is unable to run any other instances of
> excel, until kill it in TM. Any idea?
Check that oExcel is set to NIL at the end of your routine.
--
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info
Can't terminate Excel oleobject
Publicado: Vie Jul 20, 2007 3:08 pm
por jfgimenez
Gejza,
> I use the next code:
> oExcel := CREATEOBJECT( "Excel.Application" )
> oWorkBook := oExcel:WorkBooks:Add( )
> oSheet := oExcel:Get( "ActiveSheet" )
> .
> .
> Some code to fill the sheet
> .
> oWorkBook:Close(.T.)
>
> oExcel:Quit()
>
> The last line should terminate Excel, but it's runnig, listed in
> TaskManager. At this moment it is unable to run any other instances of
> excel, until kill it in TM. Any idea?
Check that oExcel is set to NIL at the end of your routine.
--
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info
Can't terminate Excel oleobject
Publicado: Vie Jul 20, 2007 3:36 pm
por Gejza Horvath
Yes,
the method ends with
oExcel := Nil
Gejza Horváth
"Jose F. Gimenez" <
jfgimenez@wanadoo.es> pí¹e v diskusním pøíspìvku
news:[email=
46a0b3ca@ozsrv2.ozlan.local...]
46a0b3ca@ozsrv2.ozlan.local...[/email]
> Gejza,
>
>> I use the next code:
>> oExcel := CREATEOBJECT( "Excel.Application" )
>> oWorkBook := oExcel:WorkBooks:Add( )
>> oSheet := oExcel:Get( "ActiveSheet" )
>> .
>> .
>> Some code to fill the sheet
>> .
>> oWorkBook:Close(.T.)
>>
>> oExcel:Quit()
>>
>> The last line should terminate Excel, but it's runnig, listed in TaskManager. At this
>> moment it is unable to run any other instances of excel, until kill it in TM. Any idea?
>
> Check that oExcel is set to NIL at the end of your routine.
>
> --
> Regards,
>
> Jose F. Gimenez
>
http://www.xailer.com
>
http://www.xailer.info
>
>
Can't terminate Excel oleobject
Publicado: Vie Jul 20, 2007 3:36 pm
por Gejza Horvath
Yes,
the method ends with
oExcel := Nil
Gejza Horváth
"Jose F. Gimenez" <
jfgimenez@wanadoo.es> pí¹e v diskusním pøíspìvku
news:[email=
46a0b3ca@ozsrv2.ozlan.local...]
46a0b3ca@ozsrv2.ozlan.local...[/email]
> Gejza,
>
>> I use the next code:
>> oExcel := CREATEOBJECT( "Excel.Application" )
>> oWorkBook := oExcel:WorkBooks:Add( )
>> oSheet := oExcel:Get( "ActiveSheet" )
>> .
>> .
>> Some code to fill the sheet
>> .
>> oWorkBook:Close(.T.)
>>
>> oExcel:Quit()
>>
>> The last line should terminate Excel, but it's runnig, listed in TaskManager. At this
>> moment it is unable to run any other instances of excel, until kill it in TM. Any idea?
>
> Check that oExcel is set to NIL at the end of your routine.
>
> --
> Regards,
>
> Jose F. Gimenez
>
http://www.xailer.com
>
http://www.xailer.info
>
>
Can't terminate Excel oleobject
Publicado: Vie Jul 20, 2007 4:17 pm
por Gejza Horvath
Jose,
I found that it is problem with object manipulation. Test code:
LOCAL oExcel,oWorkBook,oSheet
oExcel := CREATEOBJECT( "Excel.Application" )
* oWorkBook := oExcel:WorkBooks:Add( )
oExcel:Visible := .T.
oExcel:Quit()
oExcel := Nil
In this case Excel terminates. Uncomment the line
oWorkBook := oExcel:WorkBooks:Add( )
the problem occurs, Excel stays in Taskmanager as active process.
Gejza Horvath
Can't terminate Excel oleobject
Publicado: Vie Jul 20, 2007 4:17 pm
por Gejza Horvath
Jose,
I found that it is problem with object manipulation. Test code:
LOCAL oExcel,oWorkBook,oSheet
oExcel := CREATEOBJECT( "Excel.Application" )
* oWorkBook := oExcel:WorkBooks:Add( )
oExcel:Visible := .T.
oExcel:Quit()
oExcel := Nil
In this case Excel terminates. Uncomment the line
oWorkBook := oExcel:WorkBooks:Add( )
the problem occurs, Excel stays in Taskmanager as active process.
Gejza Horvath
Can't terminate Excel oleobject
Publicado: Lun Jul 23, 2007 9:18 am
por jfgimenez
Gejza,
> I found that it is problem with object manipulation. Test code:
>
> LOCAL oExcel,oWorkBook,oSheet
> oExcel := CREATEOBJECT( "Excel.Application" )
> * oWorkBook := oExcel:WorkBooks:Add( )
> oExcel:Visible := .T.
> oExcel:Quit()
>
> oExcel := Nil
>
> In this case Excel terminates. Uncomment the line
>
> oWorkBook := oExcel:WorkBooks:Add( )
>
> the problem occurs, Excel stays in Taskmanager as active process.
Try to assign Nil also to the variable oWorkBook (and any other containing
an OLE object).
--
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info
Can't terminate Excel oleobject
Publicado: Lun Jul 23, 2007 9:18 am
por jfgimenez
Gejza,
> I found that it is problem with object manipulation. Test code:
>
> LOCAL oExcel,oWorkBook,oSheet
> oExcel := CREATEOBJECT( "Excel.Application" )
> * oWorkBook := oExcel:WorkBooks:Add( )
> oExcel:Visible := .T.
> oExcel:Quit()
>
> oExcel := Nil
>
> In this case Excel terminates. Uncomment the line
>
> oWorkBook := oExcel:WorkBooks:Add( )
>
> the problem occurs, Excel stays in Taskmanager as active process.
Try to assign Nil also to the variable oWorkBook (and any other containing
an OLE object).
--
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info
Can't terminate Excel oleobject
Publicado: Mar Jul 24, 2007 9:59 am
por Gejza Horvath
Jose,
doesn't solve the problem. Process Excel.exe is terminated only ending my app. If I leave
Excel visible without quit it,
oExcel:Visible := .T.
oSheet := Nil
oWorkBook := Nil
oExcel := Nil
RETURN Nil
it's no possible to terminate it clicking on Close button
Geja Horváth
Can't terminate Excel oleobject
Publicado: Mar Jul 24, 2007 9:59 am
por Gejza Horvath
Jose,
doesn't solve the problem. Process Excel.exe is terminated only ending my app. If I leave
Excel visible without quit it,
oExcel:Visible := .T.
oSheet := Nil
oWorkBook := Nil
oExcel := Nil
RETURN Nil
it's no possible to terminate it clicking on Close button
Geja Horváth
Can't terminate Excel oleobject
Publicado: Mar Jul 24, 2007 11:45 am
por jfgimenez
Gejza,
> doesn't solve the problem. Process Excel.exe is terminated only ending my
> app. If I leave Excel visible without quit it,
>
> oExcel:Visible := .T.
> oSheet := Nil
> oWorkBook := Nil
> oExcel := Nil
>
> RETURN Nil
>
> it's no possible to terminate it clicking on Close button
It's really strange. In my apps, I use to open Excel, create a new sheet and
leave it opened and visible. And I've not had any problem. Please, send us a
small project showing the problem.
--
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info
Can't terminate Excel oleobject
Publicado: Mar Jul 24, 2007 11:45 am
por jfgimenez
Gejza,
> doesn't solve the problem. Process Excel.exe is terminated only ending my
> app. If I leave Excel visible without quit it,
>
> oExcel:Visible := .T.
> oSheet := Nil
> oWorkBook := Nil
> oExcel := Nil
>
> RETURN Nil
>
> it's no possible to terminate it clicking on Close button
It's really strange. In my apps, I use to open Excel, create a new sheet and
leave it opened and visible. And I've not had any problem. Please, send us a
small project showing the problem.
--
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info
Can't terminate Excel oleobject
Publicado: Mar Jul 24, 2007 5:30 pm
por Gejza Horvath
Jose,
the project is attached, in the Resource directory you can find the Clip1.jpg, how it
looks on my screen. In the background you can see the Excel window's frame which is no
redrawed moving my app's main window. Terminating my app, Excel is terminated too.
I tested on another comp, the same effect.
Gejza
>
> It's really strange. In my apps, I use to open Excel, create a new sheet and
> leave it opened and visible. And I've not had any problem. Please, send us a
> small project showing the problem.
>
> --
> Regards,
>
> Jose F. Gimenez
>
http://www.xailer.com
>
http://www.xailer.info
>
>
>
Attached files oletest.zip (1.7 KB)Â
Can't terminate Excel oleobject
Publicado: Mar Jul 24, 2007 5:30 pm
por Gejza Horvath
Jose,
the project is attached, in the Resource directory you can find the Clip1.jpg, how it
looks on my screen. In the background you can see the Excel window's frame which is no
redrawed moving my app's main window. Terminating my app, Excel is terminated too.
I tested on another comp, the same effect.
Gejza
>
> It's really strange. In my apps, I use to open Excel, create a new sheet and
> leave it opened and visible. And I've not had any problem. Please, send us a
> small project showing the problem.
>
> --
> Regards,
>
> Jose F. Gimenez
>
http://www.xailer.com
>
http://www.xailer.info
>
>
>
Attached files oletest.zip (1.7 KB)Â
Can't terminate Excel oleobject
Publicado: Mar Jul 24, 2007 5:35 pm
por Gejza Horvath
Here is the clip1.jpg
Gejza
Attached files Clip1.zip (29 KB)Â
Can't terminate Excel oleobject
Publicado: Mar Jul 24, 2007 5:35 pm
por Gejza Horvath
Here is the clip1.jpg
Gejza
Attached files Clip1.zip (29 KB)Â
Can't terminate Excel oleobject
Publicado: Mar Jul 24, 2007 5:37 pm
por Gejza Horvath
Here is clip1.jpg
Gejza
Attached files Clip1.zip (29 KB)Â
Can't terminate Excel oleobject
Publicado: Mar Jul 24, 2007 5:37 pm
por Gejza Horvath
Here is clip1.jpg
Gejza
Attached files Clip1.zip (29 KB)Â
Can't terminate Excel oleobject
Publicado: Mié Jul 25, 2007 12:28 am
por Nick Hilder
Hi Gents
For whats it's worth, I had this exact same problem about 3 years ago using
xharbour ole and excel. I posted it onto the xh ng at the time, it was
suggested that I Nil all the objects, in the end I had to give up and write
out a csv file instead, as I could never get excel to close properly either.
Maybe it only happens under certain configs of Windows/Excel
Regards Nick
"Gejza Horvath" <
_hsoftkn@nextra.sk> wrote in message
news:[email=
46a61cd5@ozsrv2.ozlan.local...]
46a61cd5@ozsrv2.ozlan.local...[/email]
> Here is clip1.jpg
>
> Gejza
>
>
Can't terminate Excel oleobject
Publicado: Mié Jul 25, 2007 12:28 am
por Nick Hilder
Hi Gents
For whats it's worth, I had this exact same problem about 3 years ago using
xharbour ole and excel. I posted it onto the xh ng at the time, it was
suggested that I Nil all the objects, in the end I had to give up and write
out a csv file instead, as I could never get excel to close properly either.
Maybe it only happens under certain configs of Windows/Excel
Regards Nick
"Gejza Horvath" <
_hsoftkn@nextra.sk> wrote in message
news:[email=
46a61cd5@ozsrv2.ozlan.local...]
46a61cd5@ozsrv2.ozlan.local...[/email]
> Here is clip1.jpg
>
> Gejza
>
>
Can't terminate Excel oleobject
Publicado: Mié Jul 25, 2007 7:56 am
por Gejza Horvath
Nick,
thanks for your message.
I think too, this is a Win/Excel coexisting problem , in my case Win XP Pro + Excel 2000,
but Win XP Pro + Excel 2003 doesn't work too. I found a little KillProcess.exe app on the
web, and will use it, works fine.
Gejza Horváth
"Nick Hilder" <nick_Nospam#$%@capsol.com%NOSPAM%.au> pí¹e v diskusním pøíspìvku
news:[email=
46a67d2b@ozsrv2.ozlan.local...]
46a67d2b@ozsrv2.ozlan.local...[/email]
> Hi Gents
>
> For whats it's worth, I had this exact same problem about 3 years ago using xharbour ole
> and excel. I posted it onto the xh ng at the time, it was suggested that I Nil all the
> objects, in the end I had to give up and write out a csv file instead, as I could never
> get excel to close properly either.
>
> Maybe it only happens under certain configs of Windows/Excel
>
> Regards Nick
>
> "Gejza Horvath" <
_hsoftkn@nextra.sk> wrote in message
> news:[email=
46a61cd5@ozsrv2.ozlan.local...]
46a61cd5@ozsrv2.ozlan.local...[/email]
>> Here is clip1.jpg
>>
>> Gejza
>>
>>
>
>
>
Can't terminate Excel oleobject
Publicado: Mié Jul 25, 2007 7:56 am
por Gejza Horvath
Nick,
thanks for your message.
I think too, this is a Win/Excel coexisting problem , in my case Win XP Pro + Excel 2000,
but Win XP Pro + Excel 2003 doesn't work too. I found a little KillProcess.exe app on the
web, and will use it, works fine.
Gejza Horváth
"Nick Hilder" <nick_Nospam#$%@capsol.com%NOSPAM%.au> pí¹e v diskusním pøíspìvku
news:[email=
46a67d2b@ozsrv2.ozlan.local...]
46a67d2b@ozsrv2.ozlan.local...[/email]
> Hi Gents
>
> For whats it's worth, I had this exact same problem about 3 years ago using xharbour ole
> and excel. I posted it onto the xh ng at the time, it was suggested that I Nil all the
> objects, in the end I had to give up and write out a csv file instead, as I could never
> get excel to close properly either.
>
> Maybe it only happens under certain configs of Windows/Excel
>
> Regards Nick
>
> "Gejza Horvath" <
_hsoftkn@nextra.sk> wrote in message
> news:[email=
46a61cd5@ozsrv2.ozlan.local...]
46a61cd5@ozsrv2.ozlan.local...[/email]
>> Here is clip1.jpg
>>
>> Gejza
>>
>>
>
>
>
Can't terminate Excel oleobject
Publicado: Jue Jul 26, 2007 12:05 pm
por jfgimenez
Gejza,
sorry for the delay.
> the project is attached, in the Resource directory you can find the
> Clip1.jpg, how it
> looks on my screen. In the background you can see the Excel window's frame
> which is no
> redrawed moving my app's main window. Terminating my app, Excel is
> terminated too.
>
> I tested on another comp, the same effect.
I've just tested it in my computer and is working absolutely fine. The
worksheet is created and stored in c:test.xls, and Excel finish correctly
and does not appear in the task mannager even while the program is already
running.
I can send you my .exe file if you want.
--
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info
Can't terminate Excel oleobject
Publicado: Jue Jul 26, 2007 12:05 pm
por jfgimenez
Gejza,
sorry for the delay.
> the project is attached, in the Resource directory you can find the
> Clip1.jpg, how it
> looks on my screen. In the background you can see the Excel window's frame
> which is no
> redrawed moving my app's main window. Terminating my app, Excel is
> terminated too.
>
> I tested on another comp, the same effect.
I've just tested it in my computer and is working absolutely fine. The
worksheet is created and stored in c:test.xls, and Excel finish correctly
and does not appear in the task mannager even while the program is already
running.
I can send you my .exe file if you want.
--
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info