Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Excel automation

Hi al

I am automating excel 97 from Access 97. When I finish running all my code, I leave the instance of excel open but set all references to excel objects to nothing

When I then close excel, excel.exe is not showing in the Task Manager processes. However, if I close the workbook, the instance of excel is hidden and excel.exe still shows in the Task Manager processes

Has anyone come across this. I was thinking that maybe i had left some references to excel objects still valid but cannot find where I may have done this

Would be grateful for any help

Thank
Michelle
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Excel automation

Michelle,

Are you quitting the Excel app?

xlApp.Quit

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Michelle" wrote in message
...
Hi all

I am automating excel 97 from Access 97. When I finish running all my

code, I leave the instance of excel open but set all references to excel
objects to nothing.

When I then close excel, excel.exe is not showing in the Task Manager

processes. However, if I close the workbook, the instance of excel is
hidden and excel.exe still shows in the Task Manager processes.

Has anyone come across this. I was thinking that maybe i had left some

references to excel objects still valid but cannot find where I may have
done this.

Would be grateful for any help.

Thanks
Michelle



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Excel automation

Leaving references is easy to do. You need to qualify all references from
the Excel application level or at least from a reference that leads back to
the Excel application level. Sometimes this can be subtle. For example if
you did a sort

oxlApp.Workbooks(1).Worksheets(1).Range("A1").Curr entRegion.Sort _
Key1:=Range("A1"), Order1:=xlAscending

This would create a non releasable reference, since the argument to Key1 is
an unqualified reference.

--
Regards,
Tom Ogilvy

"Michelle" wrote in message
...
Hi all

I am automating excel 97 from Access 97. When I finish running all my

code, I leave the instance of excel open but set all references to excel
objects to nothing.

When I then close excel, excel.exe is not showing in the Task Manager

processes. However, if I close the workbook, the instance of excel is
hidden and excel.exe still shows in the Task Manager processes.

Has anyone come across this. I was thinking that maybe i had left some

references to excel objects still valid but cannot find where I may have
done this.

Would be grateful for any help.

Thanks
Michelle



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default Excel automation

I am not sure I understand the problem. First you mention that you
leave the instance of XL open. OK, so XL should show up in Task
Manager.

Then you mention that you close it and it doesn't show up in the task
manager. As it shouldn't.

Then you mention that if you close the workbook XL is still running.
Shouldn't it be? The workbook is closed, XL hasn't been asked to quit.

To me it would appear that in each of the scenarios the system is doing
what you want it to do.

--
Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
Hi all

I am automating excel 97 from Access 97. When I finish running all my code, I leave the instance of excel open but set all references to excel objects to nothing.

When I then close excel, excel.exe is not showing in the Task Manager processes. However, if I close the workbook, the instance of excel is hidden and excel.exe still shows in the Task Manager processes.

Has anyone come across this. I was thinking that maybe i had left some references to excel objects still valid but cannot find where I may have done this.

Would be grateful for any help.

Thanks
Michelle

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Excel automation

Perhaps I didn't explain it properly!!! - very probably.

ok here's what happens.

when my code finishes running I leave excel open for the user to edit the spreadsheet and save etc.

at the end of my code running is
set wbRoster = nothing 'the workbook
set xlapp = nothing 'the instance of excel

while the workbook is still open, if the user closes excel, no excel.exe in processes in task manager - as expected i agree.

however, if the user closes the workbook only, the instance of excel disappears so it can't be physically closed, and therefore it still appears in the processes in the task manager.

my aim is to have excel closed whether the user closes the workbook OR the application.

Hope this clarifies my problem.

Thanks
Michelle


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default Excel automation

I could only test with XL2002 (since it was the last one installed on
my machine).

What happens is that when the workbook is closed, XL also goes away.
It's almost as if there is some application level setting that reminds
it that it was started via automation.

However, unlike your experience where XL97 remains in memory, XL2002
does not show up in the Win XP Task Manager. So, I assume it went away
properly.

It looks like you will have to come up with a detour. Maybe, you can
have an application level event procedure in an XL add-in that checks
if Windows.Count = 0 and if so does a application.quit?

--
Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
Perhaps I didn't explain it properly!!! - very probably.

ok here's what happens.

when my code finishes running I leave excel open for the user to edit the spreadsheet and save etc.

at the end of my code running is
set wbRoster = nothing 'the workbook
set xlapp = nothing 'the instance of excel

while the workbook is still open, if the user closes excel, no excel.exe in processes in task manager - as expected i agree.

however, if the user closes the workbook only, the instance of excel disappears so it can't be physically closed, and therefore it still appears in the processes in the task manager.

my aim is to have excel closed whether the user closes the workbook OR the application.

Hope this clarifies my problem.

Thanks
Michelle

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Excel automation

I believe you can do the older version with

Start=Run= path to specific verions of excel 2002/excel.exe /unregserver

Run

Then

path to older verion of excel/Excel.exe /Regserver

Run

then you can automate the older version, then reset the registry.

--
Regards,
Tom Ogilvy


"Tushar Mehta" wrote in message
news:MPG.1a95bc6990cb8ab29896d0@news-server...
I could only test with XL2002 (since it was the last one installed on
my machine).

What happens is that when the workbook is closed, XL also goes away.
It's almost as if there is some application level setting that reminds
it that it was started via automation.

However, unlike your experience where XL97 remains in memory, XL2002
does not show up in the Win XP Task Manager. So, I assume it went away
properly.

It looks like you will have to come up with a detour. Maybe, you can
have an application level event procedure in an XL add-in that checks
if Windows.Count = 0 and if so does a application.quit?

--
Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
Perhaps I didn't explain it properly!!! - very probably.

ok here's what happens.

when my code finishes running I leave excel open for the user to edit

the spreadsheet and save etc.

at the end of my code running is
set wbRoster = nothing 'the workbook
set xlapp = nothing 'the instance of excel

while the workbook is still open, if the user closes excel, no excel.exe

in processes in task manager - as expected i agree.

however, if the user closes the workbook only, the instance of excel

disappears so it can't be physically closed, and therefore it still appears
in the processes in the task manager.

my aim is to have excel closed whether the user closes the workbook OR

the application.

Hope this clarifies my problem.

Thanks
Michelle



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default Excel automation

Ah, ah. Thanks, Tom. That's almost like making it look like the older
version was loaded after the newer version -- at least as far as the
changes are made with /regserver.

--
Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
I believe you can do the older version with

Start=Run= path to specific verions of excel 2002/excel.exe /unregserver

Run

Then

path to older verion of excel/Excel.exe /Regserver

Run

then you can automate the older version, then reset the registry.


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Excel automation

Thanks to you all for your help

I did manage to find a solution which was actually quite simple

xlapp.usercontrol = tru

did the tric

Thank
Michelle
  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default Excel automation

Interesting -- and something to remember. Thanks for sharing the
resolution.

--
Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
Thanks to you all for your help.

I did manage to find a solution which was actually quite simple.

xlapp.usercontrol = true

did the trick

Thanks
Michelle

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel automation in a VB app [email protected] Excel Programming 1 January 12th 04 07:59 PM
Ole automation with Excel 10 from Vb.net Richie Weldon \(MSFT\) Excel Programming 0 November 13th 03 06:08 PM
Excel Com Automation Tom Ogilvy Excel Programming 5 November 10th 03 02:05 PM
Excel Web Automation mccaka Excel Programming 1 October 9th 03 02:18 AM
Vb.net - excel 97 automation michael Excel Programming 0 August 14th 03 06:16 PM


All times are GMT +1. The time now is 12:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"