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

VBA-run-through stopping after abount 250 items



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old September 26th 06, 05:10 PM posted to microsoft.public.outlook.program_vba
Allan
external usenet poster
 
Posts: 14
Default VBA-run-through stopping after abount 250 items

I need to run through all items (about 5000) in a public folder once in a
while. Lately I have upgraded to XP Pro and I think that might have caused
some problems.

The error I get every time the computer has read about 250 items is
"Run time error 13: Type mismatch"

When debugging and placing the cursor right on top of ".Item(intCounter)" I
can see how far the computer got in the code. Next time I can start over at
item no 249 and then I get the error around item no 500.

The code I use starts this way:

"For intCounter = 1 To objContacts.Count
Set objContact = objContacts.Item(intCounter)
With objContact
....
"

Maybe it's a memory management thing but I would like to go through all
items without stopping every 250 items. Any ideas why this happens and if it
can be cured??

I have tried to run the code on different XP Pro computers. One with 512 Mb
Ram and one with 1 Gb Ram. Same problems.

When running 2000 Pro I didn't have this problem. And I don't think I have
changed my code since then.


Regards

- Allan


(Running Exchange Server 2003 with Outlook 2003 clients)
  #2  
Old September 26th 06, 07:48 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default VBA-run-through stopping after abount 250 items

This is actually an Exchange issue:

Your Exchange Server 2003 computer may stop responding after a MAPI client
opens more than the default value of certain server objects:
http://support.microsoft.com/kb/830829/

Also, ensure that your code doesn't expect a certain type of object when
looping through items in a folder. Inspect the Item types in the collection
you are retrieving them from (like the Class or MessageClass properties, or
use TypeOf(Object)) before you assign them to an explict object type. For
example, when looping through items in a Contact folder, some items may be
Distribution Lists and they cannot be assigned to a Contact object.

--
Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Allan" wrote:

I need to run through all items (about 5000) in a public folder once in a
while. Lately I have upgraded to XP Pro and I think that might have caused
some problems.

The error I get every time the computer has read about 250 items is
"Run time error 13: Type mismatch"

When debugging and placing the cursor right on top of ".Item(intCounter)" I
can see how far the computer got in the code. Next time I can start over at
item no 249 and then I get the error around item no 500.

The code I use starts this way:

"For intCounter = 1 To objContacts.Count
Set objContact = objContacts.Item(intCounter)
With objContact
...
"

Maybe it's a memory management thing but I would like to go through all
items without stopping every 250 items. Any ideas why this happens and if it
can be cured??

I have tried to run the code on different XP Pro computers. One with 512 Mb
Ram and one with 1 Gb Ram. Same problems.

When running 2000 Pro I didn't have this problem. And I don't think I have
changed my code since then.


Regards

- Allan


(Running Exchange Server 2003 with Outlook 2003 clients)

  #3  
Old September 26th 06, 08:30 PM posted to microsoft.public.outlook.program_vba
Allan
external usenet poster
 
Posts: 14
Default VBA-run-through stopping after abount 250 items

Thank you, Eric for answaring.

I will try to modify my code. Right now I don't quite know what to modify
but I will look into it.

Unfortunately the Microsoft-link is not available.

If my problem is related to Exchange why didn't I realise the problem when
running 2K Pro on my client?

"Eric Legault [MVP - Outlook]" wrote:

This is actually an Exchange issue:

Your Exchange Server 2003 computer may stop responding after a MAPI client
opens more than the default value of certain server objects:
http://support.microsoft.com/kb/830829/

Also, ensure that your code doesn't expect a certain type of object when
looping through items in a folder. Inspect the Item types in the collection
you are retrieving them from (like the Class or MessageClass properties, or
use TypeOf(Object)) before you assign them to an explict object type. For
example, when looping through items in a Contact folder, some items may be
Distribution Lists and they cannot be assigned to a Contact object.

--
Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Allan" wrote:

I need to run through all items (about 5000) in a public folder once in a
while. Lately I have upgraded to XP Pro and I think that might have caused
some problems.

The error I get every time the computer has read about 250 items is
"Run time error 13: Type mismatch"

When debugging and placing the cursor right on top of ".Item(intCounter)" I
can see how far the computer got in the code. Next time I can start over at
item no 249 and then I get the error around item no 500.

The code I use starts this way:

"For intCounter = 1 To objContacts.Count
Set objContact = objContacts.Item(intCounter)
With objContact
...
"

Maybe it's a memory management thing but I would like to go through all
items without stopping every 250 items. Any ideas why this happens and if it
can be cured??

I have tried to run the code on different XP Pro computers. One with 512 Mb
Ram and one with 1 Gb Ram. Same problems.

When running 2000 Pro I didn't have this problem. And I don't think I have
changed my code since then.


Regards

- Allan


(Running Exchange Server 2003 with Outlook 2003 clients)

  #4  
Old September 26th 06, 08:45 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default VBA-run-through stopping after abount 250 items

You're right, it may not be Exchange related. There is another issue related
to this that seems specific to Outlook 2002, but I'm not sure if this is
relevant to Outlook 2003 or not:

OL2002: Memory or Performance Problems Looping Through Items:
http://support.microsoft.com/?kbid=293797

BTW, Microsoft's Knowledge Base seems to be having some problems this week,
so keep trying to access those articles.

Change this part of your code to handle different item types:

For intCounter = 1 To objContacts.Count
If objContacts.Item(intCounter).Class = olContact Then
Set objContact = objContacts.Item(intCounter)
'...code to work with a Contact item
Else
'...code to handle non-Contact items
End If

--
Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Allan" wrote:

Thank you, Eric for answaring.

I will try to modify my code. Right now I don't quite know what to modify
but I will look into it.

Unfortunately the Microsoft-link is not available.

If my problem is related to Exchange why didn't I realise the problem when
running 2K Pro on my client?

"Eric Legault [MVP - Outlook]" wrote:

This is actually an Exchange issue:

Your Exchange Server 2003 computer may stop responding after a MAPI client
opens more than the default value of certain server objects:
http://support.microsoft.com/kb/830829/

Also, ensure that your code doesn't expect a certain type of object when
looping through items in a folder. Inspect the Item types in the collection
you are retrieving them from (like the Class or MessageClass properties, or
use TypeOf(Object)) before you assign them to an explict object type. For
example, when looping through items in a Contact folder, some items may be
Distribution Lists and they cannot be assigned to a Contact object.

--
Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Allan" wrote:

I need to run through all items (about 5000) in a public folder once in a
while. Lately I have upgraded to XP Pro and I think that might have caused
some problems.

The error I get every time the computer has read about 250 items is
"Run time error 13: Type mismatch"

When debugging and placing the cursor right on top of ".Item(intCounter)" I
can see how far the computer got in the code. Next time I can start over at
item no 249 and then I get the error around item no 500.

The code I use starts this way:

"For intCounter = 1 To objContacts.Count
Set objContact = objContacts.Item(intCounter)
With objContact
...
"

Maybe it's a memory management thing but I would like to go through all
items without stopping every 250 items. Any ideas why this happens and if it
can be cured??

I have tried to run the code on different XP Pro computers. One with 512 Mb
Ram and one with 1 Gb Ram. Same problems.

When running 2000 Pro I didn't have this problem. And I don't think I have
changed my code since then.


Regards

- Allan


(Running Exchange Server 2003 with Outlook 2003 clients)

  #5  
Old September 26th 06, 09:00 PM posted to microsoft.public.outlook.program_vba
Allan
external usenet poster
 
Posts: 14
Default VBA-run-through stopping after abount 250 items

I will access the KB-articles later.

If I know that every item in the folder are olContacts would the code
modification you suggest then make any difference at all?

"Eric Legault [MVP - Outlook]" wrote:

You're right, it may not be Exchange related. There is another issue related
to this that seems specific to Outlook 2002, but I'm not sure if this is
relevant to Outlook 2003 or not:

OL2002: Memory or Performance Problems Looping Through Items:
http://support.microsoft.com/?kbid=293797

BTW, Microsoft's Knowledge Base seems to be having some problems this week,
so keep trying to access those articles.

Change this part of your code to handle different item types:

For intCounter = 1 To objContacts.Count
If objContacts.Item(intCounter).Class = olContact Then
Set objContact = objContacts.Item(intCounter)
'...code to work with a Contact item
Else
'...code to handle non-Contact items
End If

--
Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Allan" wrote:

Thank you, Eric for answaring.

I will try to modify my code. Right now I don't quite know what to modify
but I will look into it.

Unfortunately the Microsoft-link is not available.

If my problem is related to Exchange why didn't I realise the problem when
running 2K Pro on my client?

"Eric Legault [MVP - Outlook]" wrote:

This is actually an Exchange issue:

Your Exchange Server 2003 computer may stop responding after a MAPI client
opens more than the default value of certain server objects:
http://support.microsoft.com/kb/830829/

Also, ensure that your code doesn't expect a certain type of object when
looping through items in a folder. Inspect the Item types in the collection
you are retrieving them from (like the Class or MessageClass properties, or
use TypeOf(Object)) before you assign them to an explict object type. For
example, when looping through items in a Contact folder, some items may be
Distribution Lists and they cannot be assigned to a Contact object.

--
Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Allan" wrote:

I need to run through all items (about 5000) in a public folder once in a
while. Lately I have upgraded to XP Pro and I think that might have caused
some problems.

The error I get every time the computer has read about 250 items is
"Run time error 13: Type mismatch"

When debugging and placing the cursor right on top of ".Item(intCounter)" I
can see how far the computer got in the code. Next time I can start over at
item no 249 and then I get the error around item no 500.

The code I use starts this way:

"For intCounter = 1 To objContacts.Count
Set objContact = objContacts.Item(intCounter)
With objContact
...
"

Maybe it's a memory management thing but I would like to go through all
items without stopping every 250 items. Any ideas why this happens and if it
can be cured??

I have tried to run the code on different XP Pro computers. One with 512 Mb
Ram and one with 1 Gb Ram. Same problems.

When running 2000 Pro I didn't have this problem. And I don't think I have
changed my code since then.


Regards

- Allan


(Running Exchange Server 2003 with Outlook 2003 clients)

  #6  
Old September 26th 06, 09:08 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default VBA-run-through stopping after abount 250 items

No, the code wouldn't make a difference if you know for a fact what item
types you can expect, but it's certainly a best practice and common-sense to
never assume so and to develop with such possibilities in mind.

--
Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Allan" wrote:

I will access the KB-articles later.

If I know that every item in the folder are olContacts would the code
modification you suggest then make any difference at all?

"Eric Legault [MVP - Outlook]" wrote:

You're right, it may not be Exchange related. There is another issue related
to this that seems specific to Outlook 2002, but I'm not sure if this is
relevant to Outlook 2003 or not:

OL2002: Memory or Performance Problems Looping Through Items:
http://support.microsoft.com/?kbid=293797

BTW, Microsoft's Knowledge Base seems to be having some problems this week,
so keep trying to access those articles.

Change this part of your code to handle different item types:

For intCounter = 1 To objContacts.Count
If objContacts.Item(intCounter).Class = olContact Then
Set objContact = objContacts.Item(intCounter)
'...code to work with a Contact item
Else
'...code to handle non-Contact items
End If

--
Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Allan" wrote:

Thank you, Eric for answaring.

I will try to modify my code. Right now I don't quite know what to modify
but I will look into it.

Unfortunately the Microsoft-link is not available.

If my problem is related to Exchange why didn't I realise the problem when
running 2K Pro on my client?

"Eric Legault [MVP - Outlook]" wrote:

This is actually an Exchange issue:

Your Exchange Server 2003 computer may stop responding after a MAPI client
opens more than the default value of certain server objects:
http://support.microsoft.com/kb/830829/

Also, ensure that your code doesn't expect a certain type of object when
looping through items in a folder. Inspect the Item types in the collection
you are retrieving them from (like the Class or MessageClass properties, or
use TypeOf(Object)) before you assign them to an explict object type. For
example, when looping through items in a Contact folder, some items may be
Distribution Lists and they cannot be assigned to a Contact object.

--
Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Allan" wrote:

I need to run through all items (about 5000) in a public folder once in a
while. Lately I have upgraded to XP Pro and I think that might have caused
some problems.

The error I get every time the computer has read about 250 items is
"Run time error 13: Type mismatch"

When debugging and placing the cursor right on top of ".Item(intCounter)" I
can see how far the computer got in the code. Next time I can start over at
item no 249 and then I get the error around item no 500.

The code I use starts this way:

"For intCounter = 1 To objContacts.Count
Set objContact = objContacts.Item(intCounter)
With objContact
...
"

Maybe it's a memory management thing but I would like to go through all
items without stopping every 250 items. Any ideas why this happens and if it
can be cured??

I have tried to run the code on different XP Pro computers. One with 512 Mb
Ram and one with 1 Gb Ram. Same problems.

When running 2000 Pro I didn't have this problem. And I don't think I have
changed my code since then.


Regards

- Allan


(Running Exchange Server 2003 with Outlook 2003 clients)

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Run VBA code on receipt of e-mail White Horse Outlook and VBA 2 August 28th 06 09:51 PM
Selective Read Receipts VBA using run a script rule prideoflions Outlook and VBA 5 May 26th 06 04:31 PM
Run VBA Code from 'new mail message' on standard toolbar Carmi Outlook and VBA 8 March 31st 06 06:53 PM
Message Rule Does Not Run VBA Procedure Lowell Outlook and VBA 18 March 9th 06 07:47 PM
Max 250 items Why? Marco Outlook - General Queries 0 February 14th 06 04:13 AM


All times are GMT +1. The time now is 09:15 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.