![]() |
| If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|||||||
| Tags: closed, folder, personal, properly |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Many hours after running code, Outlook has an error message upon opening
(each time it opens now--even though the code ran once hours ago) that the Personal Folder was not closed properly, and goes through a 6 minute assessment and fix, and then finally opens. Do ALL of these "sets" need to be Set to = Nothing at the end of the routine, or just the myOlApp? Set myOlApp = CreateObject("Outlook.Application") Set myNameSpace = myOlApp.GetNamespace("MAPI") Set myPersonal = myNameSpace.Folders("Personal Folders2") |
| Ads |
|
#2
|
|||
|
|||
|
This is an indication that you code was terminated without releasing one of
the Outlook objects (which referenced a MAPI object). Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Access101" wrote in message ... Many hours after running code, Outlook has an error message upon opening (each time it opens now--even though the code ran once hours ago) that the Personal Folder was not closed properly, and goes through a 6 minute assessment and fix, and then finally opens. Do ALL of these "sets" need to be Set to = Nothing at the end of the routine, or just the myOlApp? Set myOlApp = CreateObject("Outlook.Application") Set myNameSpace = myOlApp.GetNamespace("MAPI") Set myPersonal = myNameSpace.Folders("Personal Folders2") |
|
#3
|
|||
|
|||
|
Thanks for the quick response.
Can I: A. Go back in and do something like this to fix it Set myOlApp = Nothing Exit Sub B. Go back in and do this for ALL the Set statements? "Dmitry Streblechenko" wrote: This is an indication that you code was terminated without releasing one of the Outlook objects (which referenced a MAPI object). Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Access101" wrote in message ... Many hours after running code, Outlook has an error message upon opening (each time it opens now--even though the code ran once hours ago) that the Personal Folder was not closed properly, and goes through a 6 minute assessment and fix, and then finally opens. Do ALL of these "sets" need to be Set to = Nothing at the end of the routine, or just the myOlApp? Set myOlApp = CreateObject("Outlook.Application") Set myNameSpace = myOlApp.GetNamespace("MAPI") Set myPersonal = myNameSpace.Folders("Personal Folders2") |
|
#4
|
|||
|
|||
|
No, once it is damaged, it needs to be fixed.
VB automatically releases all COM objects, so most likely your code terminates abnormally (e.g. if your app is killed in the Task Manager) Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Access101" wrote in message ... Thanks for the quick response. Can I: A. Go back in and do something like this to fix it Set myOlApp = Nothing Exit Sub B. Go back in and do this for ALL the Set statements? "Dmitry Streblechenko" wrote: This is an indication that you code was terminated without releasing one of the Outlook objects (which referenced a MAPI object). Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Access101" wrote in message ... Many hours after running code, Outlook has an error message upon opening (each time it opens now--even though the code ran once hours ago) that the Personal Folder was not closed properly, and goes through a 6 minute assessment and fix, and then finally opens. Do ALL of these "sets" need to be Set to = Nothing at the end of the routine, or just the myOlApp? Set myOlApp = CreateObject("Outlook.Application") Set myNameSpace = myOlApp.GetNamespace("MAPI") Set myPersonal = myNameSpace.Folders("Personal Folders2") |
|
#5
|
|||
|
|||
|
I'm a little confused. I asked whether I should fix it by setting Set statements = Nothing And you said, No, once it is damaged, it needs to be fixed. So setting them to = Nothing will not work, but I need to fix it somehow. How do I fix it? Are you talking Registry or something? I know that in the future, when I run the whole process, I'll have Set xxx = Nothing at the end of the sub routine ... but what can I do at this point to undo the fact that I never had those statements to close out those "variables"? "Dmitry Streblechenko" wrote: No, once it is damaged, it needs to be fixed. VB automatically releases all COM objects, so most likely your code terminates abnormally (e.g. if your app is killed in the Task Manager) Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Access101" wrote in message ... Thanks for the quick response. Can I: A. Go back in and do something like this to fix it Set myOlApp = Nothing Exit Sub B. Go back in and do this for ALL the Set statements? "Dmitry Streblechenko" wrote: This is an indication that you code was terminated without releasing one of the Outlook objects (which referenced a MAPI object). Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Access101" wrote in message ... Many hours after running code, Outlook has an error message upon opening (each time it opens now--even though the code ran once hours ago) that the Personal Folder was not closed properly, and goes through a 6 minute assessment and fix, and then finally opens. Do ALL of these "sets" need to be Set to = Nothing at the end of the routine, or just the myOlApp? Set myOlApp = CreateObject("Outlook.Application") Set myNameSpace = myOlApp.GetNamespace("MAPI") Set myPersonal = myNameSpace.Folders("Personal Folders2") |
|
#6
|
|||
|
|||
|
You can set COM objects to Nothing to force VB to immediately release the
object, but you don't have to - VBwill automatically release the object when the variable goes out of scope. For the local variable that wowuldd be when the sub exits. For the global objects thaa t will be when the app exits. If you kill your app using the Task Manager or if it crashes, VB runtime does not get a chance to run its cleanup code. Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Access101" wrote in message ... I'm a little confused. I asked whether I should fix it by setting Set statements = Nothing And you said, No, once it is damaged, it needs to be fixed. So setting them to = Nothing will not work, but I need to fix it somehow. How do I fix it? Are you talking Registry or something? I know that in the future, when I run the whole process, I'll have Set xxx = Nothing at the end of the sub routine ... but what can I do at this point to undo the fact that I never had those statements to close out those "variables"? "Dmitry Streblechenko" wrote: No, once it is damaged, it needs to be fixed. VB automatically releases all COM objects, so most likely your code terminates abnormally (e.g. if your app is killed in the Task Manager) Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Access101" wrote in message ... Thanks for the quick response. Can I: A. Go back in and do something like this to fix it Set myOlApp = Nothing Exit Sub B. Go back in and do this for ALL the Set statements? "Dmitry Streblechenko" wrote: This is an indication that you code was terminated without releasing one of the Outlook objects (which referenced a MAPI object). Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Access101" wrote in message ... Many hours after running code, Outlook has an error message upon opening (each time it opens now--even though the code ran once hours ago) that the Personal Folder was not closed properly, and goes through a 6 minute assessment and fix, and then finally opens. Do ALL of these "sets" need to be Set to = Nothing at the end of the routine, or just the myOlApp? Set myOlApp = CreateObject("Outlook.Application") Set myNameSpace = myOlApp.GetNamespace("MAPI") Set myPersonal = myNameSpace.Folders("Personal Folders2") |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Outllok 2007 - Data file not closed properly!!!! | Stan Kay | Outlook - General Queries | 29 | September 19th 08 07:29 PM |
| Outlook 2007 file not closed properly | Gary Watson | Outlook - General Queries | 3 | April 10th 07 11:01 PM |
| Persoanl folder, etc. not closed properly | Bob Griendling | Outlook - General Queries | 11 | July 13th 06 01:51 PM |
| Outlook was not closed properly This file is being checked for pro | MS Admin | Outlook - Installation | 1 | July 1st 06 12:16 PM |
| Archive Folders not closed properly | rich47 | Outlook - General Queries | 1 | February 7th 06 02:06 AM |