A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Tags: , , ,

Personal Folder not closed properly





 
 
Thread Tools Display Modes
  #1  
Old April 24th 07, 08:38 PM posted to microsoft.public.outlook.program_vba
Access101
external usenet poster
 
Posts: 12
Default Personal Folder not closed properly

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  
Old April 24th 07, 08:53 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 1,592
Default Personal Folder not closed properly

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  
Old April 24th 07, 09:08 PM posted to microsoft.public.outlook.program_vba
Access101
external usenet poster
 
Posts: 12
Default Personal Folder not closed properly

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  
Old April 24th 07, 10:45 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 1,592
Default Personal Folder not closed properly

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  
Old April 25th 07, 12:52 AM posted to microsoft.public.outlook.program_vba
Access101
external usenet poster
 
Posts: 12
Default Personal Folder not closed properly


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  
Old April 25th 07, 01:15 AM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 1,592
Default Personal Folder not closed properly

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 05:45 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2008 Outlook Banter, part of the NewsgroupBanter project.
The comments are property of their posters.
Loans - Mobile Phone - 0 Credit Cards - Homeowner Loans - Gym Lockers