Outlook 2007/Exchange 2003 error when creating multiple items

T

Tadwick

I am using VBA to send a number of meeting invites to a resource mailbox for
some testing. I get the following message once about 131 items have been
sent.

"Error -2147220731 : Your server administrator has limited the number of
items you can open simultaneously. Try closing messages you have opened or
removing attachments and images from unsent messages you are composing."

In my code I save and send each item and then set the itm and application
objects to nothing.

Any ideas why Outlook or Exchange assume I have so much open?
 
K

Ken Slovak - [MVP - Outlook]

The 255 channel RPC limit that Exchange imposes (changeable from the server
registry) is what you are seeing.

In a loop the internal variables that are created plus any explicit objects
that you create may not necessarily be released until the procedure with the
loop is terminated.

Make sure that you assign explicit object variables instead of using
compound dot operators and make sure to release all the object variables in
each pass of the loop. That might help some. If that's not enough you might
just have to call your loop procedure multiple times, maintaining a counter
until you run through the entire collection. That would let the RPC channels
be released as the procedure ends and the objects it declares both
implicitly and explicitly go out of scope.
 
K

Ken Slovak - [MVP - Outlook]

Is this Outlook VBA? If so never create an instance of the Outlook
application. Always use the intrinsic Application object.

I'm wondering if all those sent items are still in Outbox when you get the
error?

After all those settings changes did you change the metric where the error
occurs?
 
T

Tadwick

Hi Ken,

Is this better?


Dim oApp As Outlook.Application 'Outlook application instance
Dim oItm As Outlook.AppointmentItem 'Outlook item object

Set oApp = New Outlook.Application
Set oItm = Application.CreateItem(olAppointmentItem)

The outbox didn't look like it was being accessed and the program code still
hung after about 131 items sent, even with all the client/server side
adjustments.
 
K

Ken Slovak - [MVP - Outlook]

No declarations are needed at all, and you don't need to declare an
Outlook.Application object if you don't want to.

Dim oApp As Outlook.Application
Set oApp = Application
Set oItm = oApp.CreateItem(olAppointmentItem)

or just

Set oItm = Application.CreateItem(olAppointmentItem)

I don't understand what you mean by "The outbox didn't look like it was
being accessed".

If you send the items they should be in Outbox or if sent from there they
should be in Sent Items.

Offhand I have no idea why you are receiving that error still after all the
changes. All I can suggest is to limit your calls to send to 100 at a clip
and do that repeatedly.
 
B

Brian Scheele

I am having the same issue, except mine has nothing to do with any code that
was written. Sometimes I have "too many" items open and it causes this or I
have nothing open at all except an email I am trying to reply to and I get
the message. Sometimes it is just an Operation Failed message, so then I try
to save it to drafts and I get the Your server administrator has limited the
number of items message

I posted my full message with this subject a short while ago:

Subject: Your server administrator has limited the number of items you can
2/23/2007 6:10 AM PST
--


Brian Scheele
IT Manager
Clark Filter
3649 Hempland Road
Lancaster, PA 17601-1323
 
T

Tadwick

Brian - thanks for letting me know


Brian Scheele said:
I am having the same issue, except mine has nothing to do with any code that
was written. Sometimes I have "too many" items open and it causes this or I
have nothing open at all except an email I am trying to reply to and I get
the message. Sometimes it is just an Operation Failed message, so then I try
to save it to drafts and I get the Your server administrator has limited the
number of items message

I posted my full message with this subject a short while ago:

Subject: Your server administrator has limited the number of items you can
2/23/2007 6:10 AM PST
--


Brian Scheele
IT Manager
Clark Filter
3649 Hempland Road
Lancaster, PA 17601-1323
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top