Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Excel 2003/XP Pro
Using the Windows Task Manager I seem to have a instance of Excel.exe that will not go away. My Addin creates a second instance of excel, works some code and then closes itself, or so I thought. The file closes, the instance disappears and returns me to the original instance, but I recently noticed that the windows task manager still shows a process (not using resources 00) .. Even if i close the original instance the process list just drops from 2 excel.exe on list to one. Although i have tried numerous manual and code methods for closing I can only clear the Task manager list by rebooting. if i run ym code it creates a list item in task manager for each run, so without reboot I can get a long list. Should I be concerned? Am i missing something in the shutdown? Have listed the basic code snippits below Public XLNewSpecial As Object Public XLUser As Object Set XLUser = GetObject(, "excel.application") ' so I can call the original instance when needed Set XLNewSpecial = CreateObject("excel.application") Application.Visible = True ' along withother settings 'code here to do suff 'explicit closing code XLNewSpecial .Quit Set XLNewSpecial = Nothing The code looks like it works fine with the exception that the Task Manager will not release my special instance of Excel with out a reboot. to be specific WTM shhows a process but not the application, after my closing. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you use any unqualified reference within your code you will get a ghost
reference which you have no way of releasing and you experience what you are experiencing. An unqualified reference might be ActiveCell.value = 6 rather than xlNewSpecial.ActiveCell.value = 6 -- Regards, Tom Ogilvy "Vacation's Over" wrote in message ... Excel 2003/XP Pro Using the Windows Task Manager I seem to have a instance of Excel.exe that will not go away. My Addin creates a second instance of excel, works some code and then closes itself, or so I thought. The file closes, the instance disappears and returns me to the original instance, but I recently noticed that the windows task manager still shows a process (not using resources 00) . Even if i close the original instance the process list just drops from 2 excel.exe on list to one. Although i have tried numerous manual and code methods for closing I can only clear the Task manager list by rebooting. if i run ym code it creates a list item in task manager for each run, so without reboot I can get a long list. Should I be concerned? Am i missing something in the shutdown? Have listed the basic code snippits below Public XLNewSpecial As Object Public XLUser As Object Set XLUser = GetObject(, "excel.application") ' so I can call the original instance when needed Set XLNewSpecial = CreateObject("excel.application") Application.Visible = True ' along withother settings 'code here to do suff 'explicit closing code XLNewSpecial .Quit Set XLNewSpecial = Nothing The code looks like it works fine with the exception that the Task Manager will not release my special instance of Excel with out a reboot. to be specific WTM shhows a process but not the application, after my closing. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Tom
i'll review my code One Follow up, my new instance immediately opens an addin where the majority of the code resides. It also opens a Template for displays. I understand from your post that references to my template will need to be qualified, however I just want to be sure that ThisWorkbook is still considered a qualified reference.... example: XLNewSpecial.MyTemplate.Sheets() and ThisWorkbook.Sheets() "Tom Ogilvy" wrote: If you use any unqualified reference within your code you will get a ghost reference which you have no way of releasing and you experience what you are experiencing. An unqualified reference might be ActiveCell.value = 6 rather than xlNewSpecial.ActiveCell.value = 6 -- Regards, Tom Ogilvy "Vacation's Over" wrote in message ... Excel 2003/XP Pro Using the Windows Task Manager I seem to have a instance of Excel.exe that will not go away. My Addin creates a second instance of excel, works some code and then closes itself, or so I thought. The file closes, the instance disappears and returns me to the original instance, but I recently noticed that the windows task manager still shows a process (not using resources 00) . Even if i close the original instance the process list just drops from 2 excel.exe on list to one. Although i have tried numerous manual and code methods for closing I can only clear the Task manager list by rebooting. if i run ym code it creates a list item in task manager for each run, so without reboot I can get a long list. Should I be concerned? Am i missing something in the shutdown? Have listed the basic code snippits below Public XLNewSpecial As Object Public XLUser As Object Set XLUser = GetObject(, "excel.application") ' so I can call the original instance when needed Set XLNewSpecial = CreateObject("excel.application") Application.Visible = True ' along withother settings 'code here to do suff 'explicit closing code XLNewSpecial .Quit Set XLNewSpecial = Nothing The code looks like it works fine with the exception that the Task Manager will not release my special instance of Excel with out a reboot. to be specific WTM shhows a process but not the application, after my closing. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you are running code from within the new instance, I can't say much about
that. You code wouldn't see that, so I doubt it would create this type of problem unless it leaves your new instance in a state where it can't be closed. My comments were aimed at the code that creates the new instance. No matter how few the lines are, there is usually ample opportunity to create a ghost reference. but see Tushar's link. -- Regards, Tom Ogilvy "Vacation's Over" wrote in message ... Thanks Tom i'll review my code One Follow up, my new instance immediately opens an addin where the majority of the code resides. It also opens a Template for displays. I understand from your post that references to my template will need to be qualified, however I just want to be sure that ThisWorkbook is still considered a qualified reference.... example: XLNewSpecial.MyTemplate.Sheets() and ThisWorkbook.Sheets() "Tom Ogilvy" wrote: If you use any unqualified reference within your code you will get a ghost reference which you have no way of releasing and you experience what you are experiencing. An unqualified reference might be ActiveCell.value = 6 rather than xlNewSpecial.ActiveCell.value = 6 -- Regards, Tom Ogilvy "Vacation's Over" wrote in message ... Excel 2003/XP Pro Using the Windows Task Manager I seem to have a instance of Excel.exe that will not go away. My Addin creates a second instance of excel, works some code and then closes itself, or so I thought. The file closes, the instance disappears and returns me to the original instance, but I recently noticed that the windows task manager still shows a process (not using resources 00) . Even if i close the original instance the process list just drops from 2 excel.exe on list to one. Although i have tried numerous manual and code methods for closing I can only clear the Task manager list by rebooting. if i run ym code it creates a list item in task manager for each run, so without reboot I can get a long list. Should I be concerned? Am i missing something in the shutdown? Have listed the basic code snippits below Public XLNewSpecial As Object Public XLUser As Object Set XLUser = GetObject(, "excel.application") ' so I can call the original instance when needed Set XLNewSpecial = CreateObject("excel.application") Application.Visible = True ' along withother settings 'code here to do suff 'explicit closing code XLNewSpecial .Quit Set XLNewSpecial = Nothing The code looks like it works fine with the exception that the Task Manager will not release my special instance of Excel with out a reboot. to be specific WTM shhows a process but not the application, after my closing. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Advanced Filter - Criteria Range issue | Excel Discussion (Misc queries) | |||
advanced filter issue | Excel Discussion (Misc queries) | |||
Advanced Filter Issue | Excel Discussion (Misc queries) | |||
Advanced Filter Issue | Excel Discussion (Misc queries) | |||
Advanced Sortting Issue | Excel Discussion (Misc queries) |