Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel automation in a VB app | Excel Programming | |||
Ole automation with Excel 10 from Vb.net | Excel Programming | |||
Excel Com Automation | Excel Programming | |||
Excel Web Automation | Excel Programming | |||
Vb.net - excel 97 automation | Excel Programming |