In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

Can't terminate Excel oleobject

Xailer professional forum in English
Gejza Horvath
Mensajes: 281
Registrado: Mar Ago 15, 2006 1:50 pm

Can't terminate Excel oleobject

Mensaje 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
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5718
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

Can't terminate Excel oleobject

Mensaje 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
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5718
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

Can't terminate Excel oleobject

Mensaje 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
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Gejza Horvath
Mensajes: 281
Registrado: Mar Ago 15, 2006 1:50 pm

Can't terminate Excel oleobject

Mensaje 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
>
>
Gejza Horvath
Mensajes: 281
Registrado: Mar Ago 15, 2006 1:50 pm

Can't terminate Excel oleobject

Mensaje 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
>
>
Gejza Horvath
Mensajes: 281
Registrado: Mar Ago 15, 2006 1:50 pm

Can't terminate Excel oleobject

Mensaje 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
Gejza Horvath
Mensajes: 281
Registrado: Mar Ago 15, 2006 1:50 pm

Can't terminate Excel oleobject

Mensaje 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
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5718
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

Can't terminate Excel oleobject

Mensaje 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
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5718
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

Can't terminate Excel oleobject

Mensaje 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
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Gejza Horvath
Mensajes: 281
Registrado: Mar Ago 15, 2006 1:50 pm

Can't terminate Excel oleobject

Mensaje 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
Gejza Horvath
Mensajes: 281
Registrado: Mar Ago 15, 2006 1:50 pm

Can't terminate Excel oleobject

Mensaje 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
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5718
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

Can't terminate Excel oleobject

Mensaje 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
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5718
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

Can't terminate Excel oleobject

Mensaje 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
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Gejza Horvath
Mensajes: 281
Registrado: Mar Ago 15, 2006 1:50 pm

Can't terminate Excel oleobject

Mensaje 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)Â
Gejza Horvath
Mensajes: 281
Registrado: Mar Ago 15, 2006 1:50 pm

Can't terminate Excel oleobject

Mensaje 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)Â
Gejza Horvath
Mensajes: 281
Registrado: Mar Ago 15, 2006 1:50 pm

Can't terminate Excel oleobject

Mensaje por Gejza Horvath »

Here is the clip1.jpg
Gejza


Attached files Clip1.zip (29 KB)Â
Gejza Horvath
Mensajes: 281
Registrado: Mar Ago 15, 2006 1:50 pm

Can't terminate Excel oleobject

Mensaje por Gejza Horvath »

Here is the clip1.jpg
Gejza


Attached files Clip1.zip (29 KB)Â
Gejza Horvath
Mensajes: 281
Registrado: Mar Ago 15, 2006 1:50 pm

Can't terminate Excel oleobject

Mensaje por Gejza Horvath »

Here is clip1.jpg
Gejza


Attached files Clip1.zip (29 KB)Â
Gejza Horvath
Mensajes: 281
Registrado: Mar Ago 15, 2006 1:50 pm

Can't terminate Excel oleobject

Mensaje por Gejza Horvath »

Here is clip1.jpg
Gejza


Attached files Clip1.zip (29 KB)Â
Nick Hilder
Mensajes: 328
Registrado: Mar Nov 21, 2006 2:10 am

Can't terminate Excel oleobject

Mensaje 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
>
>
Nick Hilder
Mensajes: 328
Registrado: Mar Nov 21, 2006 2:10 am

Can't terminate Excel oleobject

Mensaje 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
>
>
Gejza Horvath
Mensajes: 281
Registrado: Mar Ago 15, 2006 1:50 pm

Can't terminate Excel oleobject

Mensaje 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
>>
>>
>
>
>
Gejza Horvath
Mensajes: 281
Registrado: Mar Ago 15, 2006 1:50 pm

Can't terminate Excel oleobject

Mensaje 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
>>
>>
>
>
>
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5718
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

Can't terminate Excel oleobject

Mensaje 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
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5718
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

Can't terminate Excel oleobject

Mensaje 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
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Responder