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

Open RPC channel limit trouble



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 18th 06, 11:06 AM posted to microsoft.public.outlook.program_vba
Vaughan
external usenet poster
 
Posts: 32
Default Open RPC channel limit trouble

I need to extract some data from custom items in a public folder and transfer
it to an Access database. The trouble is, after the first 249 items my code
can't open any more items. The trouble is definitely with the limit of 255
open RPC channels.

I understand the normal advice is to make sure all your objects are closed
in the reverse order they were opended, and to attempt to release the
channels between processing items. I have taken my code and stripped it down
to remove all the distractions, and this is what is left.

Sub Printx()
Dim objApp As Outlook.Application
Dim objExp As Explorer
Dim objFolder As Outlook.MAPIFolder
Dim colJobItems As Outlook.Items
Dim objJobItem As Outlook.PostItem
Dim x As Integer

Set objApp = CreateObject("Outlook.Application")
Set objExp = objApp.ActiveExplorer
Set objFolder = objExp.CurrentFolder
Set colJobItems = objFolder.Items
Set objJobItem = colJobItems.GetFirst
x = 1
Do While Not objJobItem Is Nothing
Debug.Print x 'To hold the place of my actual processing
x = x + 1
Set objJobItem = Nothing
Set objJobItem = colJobItems.GetNext
Loop
Set objJobItem = Nothing
Set colJobItems = Nothing
Set objFolder = Nothing
Set objExp = Nothing
Set objApp = Nothing
End Sub

I have also tried it without the Do While .. Loop, and called the whole
thing from a "For x = 0 to 300 ... Next" construction, but I still get the
same problem: 249 successful read/writes then it all packs up. Can anyone
suggest how I might make this work.

I really hope someone can give me some useful advice here.

Thanks inadvance

Vaughan
Ads
  #2  
Old March 20th 06, 03:42 PM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 2
Default Open RPC channel limit trouble

What about counting the first 240 items, then closing and setting to
nothing your folder, explorer window, and application. Then recreating
your folder, exp window and app, then doing the next 240.

Inside your loop you would have an item counter 'y', which increments
every time. Then have an if statement, if y 240 then close
everything, open everything, reset y to 0.

It's a clumsy workaround, and I haven't tested it, but it's an idea.

  #3  
Old March 20th 06, 04:11 PM posted to microsoft.public.outlook.program_vba
Vaughan
external usenet poster
 
Posts: 32
Default Open RPC channel limit trouble


Further to this, I have found that defining "objJobItem" as "Object" rather
than "Outlook.PostItem" with the rest of the code as shown below avoids the
open RPC channel limit problem. BUT if I then try to extract the value from a
UserProperty, the problem reappears.

Does this make any sense to anyone?

TIA

Vaughan


"Vaughan" wrote:

I need to extract some data from custom items in a public folder and transfer
it to an Access database. The trouble is, after the first 249 items my code
can't open any more items. The trouble is definitely with the limit of 255
open RPC channels.

I understand the normal advice is to make sure all your objects are closed
in the reverse order they were opended, and to attempt to release the
channels between processing items. I have taken my code and stripped it down
to remove all the distractions, and this is what is left.

Sub Printx()
Dim objApp As Outlook.Application
Dim objExp As Explorer
Dim objFolder As Outlook.MAPIFolder
Dim colJobItems As Outlook.Items
Dim objJobItem As Outlook.PostItem
Dim x As Integer

Set objApp = CreateObject("Outlook.Application")
Set objExp = objApp.ActiveExplorer
Set objFolder = objExp.CurrentFolder
Set colJobItems = objFolder.Items
Set objJobItem = colJobItems.GetFirst
x = 1
Do While Not objJobItem Is Nothing
Debug.Print x 'To hold the place of my actual processing
x = x + 1
Set objJobItem = Nothing
Set objJobItem = colJobItems.GetNext
Loop
Set objJobItem = Nothing
Set colJobItems = Nothing
Set objFolder = Nothing
Set objExp = Nothing
Set objApp = Nothing
End Sub

I have also tried it without the Do While .. Loop, and called the whole
thing from a "For x = 0 to 300 ... Next" construction, but I still get the
same problem: 249 successful read/writes then it all packs up. Can anyone
suggest how I might make this work.

I really hope someone can give me some useful advice here.

Thanks inadvance

Vaughan

  #4  
Old March 20th 06, 04:55 PM posted to microsoft.public.outlook.program_vba
Vaughan
external usenet poster
 
Posts: 32
Default Open RPC channel limit trouble

Thanks for your suggestion Stuart. I did try this, but it turns out this
doesn't close the channels. I even cloned the code to make two seprate
routines and called them from a third one - no luck. I just don't seem to be
able to close the channels until the code runs out.

" wrote:

What about counting the first 240 items, then closing and setting to
nothing your folder, explorer window, and application. Then recreating
your folder, exp window and app, then doing the next 240.

Inside your loop you would have an item counter 'y', which increments
every time. Then have an if statement, if y 240 then close
everything, open everything, reset y to 0.

It's a clumsy workaround, and I haven't tested it, but it's an idea.


  #5  
Old April 2nd 06, 01:26 PM posted to microsoft.public.outlook.program_vba
Rajesh CKR
external usenet poster
 
Posts: 2
Default Open RPC channel limit trouble

Hi,

DId you get any resolve for this issue? I am having exactly same problem but
in C++
Raj
"Vaughan" wrote in message
...
I need to extract some data from custom items in a public folder and
transfer
it to an Access database. The trouble is, after the first 249 items my
code
can't open any more items. The trouble is definitely with the limit of 255
open RPC channels.

I understand the normal advice is to make sure all your objects are closed
in the reverse order they were opended, and to attempt to release the
channels between processing items. I have taken my code and stripped it
down
to remove all the distractions, and this is what is left.

Sub Printx()
Dim objApp As Outlook.Application
Dim objExp As Explorer
Dim objFolder As Outlook.MAPIFolder
Dim colJobItems As Outlook.Items
Dim objJobItem As Outlook.PostItem
Dim x As Integer

Set objApp = CreateObject("Outlook.Application")
Set objExp = objApp.ActiveExplorer
Set objFolder = objExp.CurrentFolder
Set colJobItems = objFolder.Items
Set objJobItem = colJobItems.GetFirst
x = 1
Do While Not objJobItem Is Nothing
Debug.Print x 'To hold the place of my actual processing
x = x + 1
Set objJobItem = Nothing
Set objJobItem = colJobItems.GetNext
Loop
Set objJobItem = Nothing
Set colJobItems = Nothing
Set objFolder = Nothing
Set objExp = Nothing
Set objApp = Nothing
End Sub

I have also tried it without the Do While .. Loop, and called the whole
thing from a "For x = 0 to 300 ... Next" construction, but I still get the
same problem: 249 successful read/writes then it all packs up. Can anyone
suggest how I might make this work.

I really hope someone can give me some useful advice here.

Thanks inadvance

Vaughan



  #6  
Old April 12th 06, 09:04 AM posted to microsoft.public.outlook.program_vba
Vaughan
external usenet poster
 
Posts: 32
Default Open RPC channel limit trouble

Hi Rajesh

I never found a solution to this. In the end I had to change my approach to
limit the number of records I was processing to less than 249, and then run
the process several times manually. Its not an acceptable solution, but I
don't have time to resolve it at the moment.

If you find out anything, I'd be grateful for any pointers.

Regards

Vaughan

"Rajesh CKR" wrote:

Hi,

DId you get any resolve for this issue? I am having exactly same problem but
in C++
Raj
"Vaughan" wrote in message
...
I need to extract some data from custom items in a public folder and
transfer
it to an Access database. The trouble is, after the first 249 items my
code
can't open any more items. The trouble is definitely with the limit of 255
open RPC channels.

I understand the normal advice is to make sure all your objects are closed
in the reverse order they were opended, and to attempt to release the
channels between processing items. I have taken my code and stripped it
down
to remove all the distractions, and this is what is left.

Sub Printx()
Dim objApp As Outlook.Application
Dim objExp As Explorer
Dim objFolder As Outlook.MAPIFolder
Dim colJobItems As Outlook.Items
Dim objJobItem As Outlook.PostItem
Dim x As Integer

Set objApp = CreateObject("Outlook.Application")
Set objExp = objApp.ActiveExplorer
Set objFolder = objExp.CurrentFolder
Set colJobItems = objFolder.Items
Set objJobItem = colJobItems.GetFirst
x = 1
Do While Not objJobItem Is Nothing
Debug.Print x 'To hold the place of my actual processing
x = x + 1
Set objJobItem = Nothing
Set objJobItem = colJobItems.GetNext
Loop
Set objJobItem = Nothing
Set colJobItems = Nothing
Set objFolder = Nothing
Set objExp = Nothing
Set objApp = Nothing
End Sub

I have also tried it without the Do While .. Loop, and called the whole
thing from a "For x = 0 to 300 ... Next" construction, but I still get the
same problem: 249 successful read/writes then it all packs up. Can anyone
suggest how I might make this work.

I really hope someone can give me some useful advice here.

Thanks inadvance

Vaughan




  #7  
Old April 18th 06, 05:06 PM posted to microsoft.public.outlook.program_vba
Rajesh CKR
external usenet poster
 
Posts: 2
Default Open RPC channel limit trouble

Neither I found a workaround..

I moved away from OOM to accessing items using CDO via a COM wrapper that I
wrote and I am happy there...

Raj

"Vaughan" wrote in message
...
Hi Rajesh

I never found a solution to this. In the end I had to change my approach
to
limit the number of records I was processing to less than 249, and then
run
the process several times manually. Its not an acceptable solution, but I
don't have time to resolve it at the moment.

If you find out anything, I'd be grateful for any pointers.

Regards

Vaughan

"Rajesh CKR" wrote:

Hi,

DId you get any resolve for this issue? I am having exactly same problem
but
in C++
Raj
"Vaughan" wrote in message
...
I need to extract some data from custom items in a public folder and
transfer
it to an Access database. The trouble is, after the first 249 items my
code
can't open any more items. The trouble is definitely with the limit of
255
open RPC channels.

I understand the normal advice is to make sure all your objects are
closed
in the reverse order they were opended, and to attempt to release the
channels between processing items. I have taken my code and stripped it
down
to remove all the distractions, and this is what is left.

Sub Printx()
Dim objApp As Outlook.Application
Dim objExp As Explorer
Dim objFolder As Outlook.MAPIFolder
Dim colJobItems As Outlook.Items
Dim objJobItem As Outlook.PostItem
Dim x As Integer

Set objApp = CreateObject("Outlook.Application")
Set objExp = objApp.ActiveExplorer
Set objFolder = objExp.CurrentFolder
Set colJobItems = objFolder.Items
Set objJobItem = colJobItems.GetFirst
x = 1
Do While Not objJobItem Is Nothing
Debug.Print x 'To hold the place of my actual processing
x = x + 1
Set objJobItem = Nothing
Set objJobItem = colJobItems.GetNext
Loop
Set objJobItem = Nothing
Set colJobItems = Nothing
Set objFolder = Nothing
Set objExp = Nothing
Set objApp = Nothing
End Sub

I have also tried it without the Do While .. Loop, and called the whole
thing from a "For x = 0 to 300 ... Next" construction, but I still get
the
same problem: 249 successful read/writes then it all packs up. Can
anyone
suggest how I might make this work.

I really hope someone can give me some useful advice here.

Thanks inadvance

Vaughan






 




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
rpc over https Simon Glencross Outlook - Installation 1 March 17th 06 02:41 PM
rpc/https [email protected] Outlook - General Queries 0 March 17th 06 05:11 AM
How does RPC over HTTPS work. Robert Dorans Outlook - Installation 1 March 15th 06 12:17 AM
rpc problem jmiller Outlook - Installation 9 February 13th 06 03:49 PM
rpc over http jmiller Outlook - Installation 2 February 5th 06 02:09 PM


All times are GMT +1. The time now is 05:07 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.