Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   Outlook 2007/Exchange 2003 error when creating multiple items (http://www.outlookbanter.com/outlook-vba/37775-outlook-2007-exchange-2003-error.html)

Tadwick January 15th 07 07:53 AM

Outlook 2007/Exchange 2003 error when creating multiple items
 
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?

Ken Slovak - [MVP - Outlook] January 15th 07 04:05 PM

Outlook 2007/Exchange 2003 error when creating multiple items
 
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.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Tadwick" wrote in message
...
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?



Tadwick January 15th 07 11:18 PM

Outlook 2007/Exchange 2003 error when creating multiple items
 
Hi Ken,

Thanks for all those suggestions. I tried all the coding suggestions but to
no avail. I also tried applying the latest service pack and changing the
server registry settings following
http://technet.microsoft.com/en-us/l.../aa997175.aspx (ie Max RPC Calls
Outstanding (500) , Gateway In Threads (2) and Gateway Out Threads (2) -
hopefully this was right).

Here's my code - maybe I haven't followed your suggestions on assigning
variables properly.
------------------------------------------------------------
Option Explicit

Sub BookResources()
'************************************************* **********
'Purpose is to book several resources programmatically
'
'Approach is to create an appointment item with Outlook object
'model and send to the resource mailbox.
'
'Environment is XP Pro SP2 w/OL2007, Windows Server 2003
'w/Exchange Server 2003 SP2
'
'Prerequisites are resource mailboxes created as windows
'accounts with calendar options set to accept all meeting
'requests and author permissions granted to client account
'************************************************* **********

Dim Rcps(10) As String 'Array of resource names (recipients)

Dim PeriodStart As Date 'Date when you want to start book resources
Dim PeriodEnd As Date 'Date when you want to stop booking resources

Dim AppStart As Date 'Start of a randomly generated appointment
Dim AppEnd As Date 'End of that appointment
Dim NextDay As Date 'Used for date calculations

'All duration and offset units are hours
Dim MinDuration As Single 'Minimum appointment duration
Dim MaxDuration As Single 'Maximum appointment duration

Dim MinOffset As Integer 'Minimum time til next appointment
Dim MaxOffset As Integer 'Maximum time til next appointment

Dim i As Integer 'Counter

Dim Offset As Integer 'Calculated offset til next appointment
Dim Duration As Integer 'Calculated appointment duration

On Error GoTo eh 'Set up error handling

'Define meeting rooms
Rcps(0) = "Room Arbutus"
Rcps(1) = "Room Balsa"
Rcps(2) = "Room Beech"
Rcps(3) = "Room Cedar"
Rcps(4) = "Room Cherry"
Rcps(5) = "Room Fir"
Rcps(6) = "Room Hemlock"
Rcps(7) = "Room Madrone"
Rcps(8) = "Room Oak"
Rcps(9) = "Room Willow"

PeriodStart = DateSerial(2007, 1, 15)
PeriodEnd = DateAdd("m", 6, PeriodStart) 'Going to add 6 months worth of
appointments

MinDuration = 0.5 'hours
MaxDuration = 12

MinOffset = 0
MaxOffset = 6


'for each resource
For i = 0 To 9
AppStart = PeriodStart
AppEnd = PeriodStart

Do While AppStart PeriodEnd

Duration = 30 * Int((CInt(2 * MaxDuration) - CInt(2 * MinDuration) +
1) * Rnd * Rnd * Rnd + CInt(2 * MinDuration))
Offset = 60 * Int((MaxOffset - MinOffset + 1) * Rnd + MinOffset)

'Make sure appointment starts no earlier than 0800 or later than 2030
'and that it doesn't occur on a weekend
AppStart = DateAdd("n", Offset, AppEnd)

If AppStart DateAdd("h", 20.5, DateSerial(Year(AppStart),
Month(AppStart), Day(AppStart))) Then
NextDay = DateAdd("d", 1, DateSerial(Year(AppStart),
Month(AppStart), Day(AppStart)))
AppStart = DateAdd("h", 8, NextDay)
ElseIf Hour(AppStart) 8 Then
AppStart = DateAdd("h", 8, DateSerial(Year(AppStart),
Month(AppStart), Day(AppStart)))
AppStart = DateAdd("n", Offset, AppStart)
End If

If Weekday(AppStart, vbMonday) 5 Then 'move to next week
AppStart = DateAdd("d", 2, DateSerial(Year(AppStart),
Month(AppStart), Day(AppStart)))
AppStart = DateAdd("h", 8, AppStart)
AppStart = DateAdd("n", Offset, AppStart)
End If

AppEnd = DateAdd("n", Duration, AppStart)
If Weekday(AppEnd, vbMonday) vbFriday Then 'end today
AppEnd = DateSerial(Year(AppEnd), Month(AppEnd), Day(AppEnd))
AppEnd = DateAdd("h", 21, AppEnd)
End If

If AppEnd DateAdd("h", 21, DateSerial(Year(AppEnd), Month(AppEnd),
Day(AppEnd))) Then
AppEnd = DateAdd("h", 21, DateSerial(Year(AppEnd),
Month(AppEnd), Day(AppEnd)))
End If


Duration = DateDiff("n", AppStart, AppEnd)

BookResource Rcps(i), AppStart, Duration

Debug.Print j & ", " & Rcps(i) & ", " & AppStart & ", " & AppEnd &
", " & Duration

Loop
Next


'Quit procedure
Exit Sub

'Error handler
eh:
MsgBox "Error : " & Err.Number & ", " & Err.Description
Resume Next

End Sub


Sub BookResource(Rcp As String, AppStart As Date, Duration As Integer)

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

On Error GoTo eh

Set oItm = oApp.CreateItem(olAppointmentItem)

'Define the item as a meeting and set other attributes
oItm.MeetingStatus = olMeeting

Select Case Duration
Case 0 To 60
oItm.Subject = "Short Meeting"
Case 61 To 1440
oItm.Subject = "Long Meeting"
Case Else
oItm.Subject = "Very Long Meeting"
End Select

oItm.Location = Rcp
oItm.Start = AppStart
oItm.Duration = Duration

'Add recipient
oItm.Resources = Rcp

'Define recipient as a resource


oItm.Save
oItm.Send

'Clean up objects
Set oItm = Nothing
Set oApp = Nothing

'Quit procedure
Exit Sub

'Error handler
eh:
MsgBox "Error : " & Err.Number & ", " & Err.Description

End Sub








"Ken Slovak - [MVP - Outlook]" wrote:

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.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Tadwick" wrote in message
...
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?




Ken Slovak - [MVP - Outlook] January 16th 07 12:03 AM

Outlook 2007/Exchange 2003 error when creating multiple items
 
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?

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Tadwick" wrote in message
...
Hi Ken,

Thanks for all those suggestions. I tried all the coding suggestions but
to
no avail. I also tried applying the latest service pack and changing the
server registry settings following
http://technet.microsoft.com/en-us/l.../aa997175.aspx (ie Max RPC Calls
Outstanding (500) , Gateway In Threads (2) and Gateway Out Threads (2) -
hopefully this was right).

Here's my code - maybe I haven't followed your suggestions on assigning
variables properly.
------------------------------------------------------------
Option Explicit

Sub BookResources()
'************************************************* **********
'Purpose is to book several resources programmatically
'
'Approach is to create an appointment item with Outlook object
'model and send to the resource mailbox.
'
'Environment is XP Pro SP2 w/OL2007, Windows Server 2003
'w/Exchange Server 2003 SP2
'
'Prerequisites are resource mailboxes created as windows
'accounts with calendar options set to accept all meeting
'requests and author permissions granted to client account
'************************************************* **********

Dim Rcps(10) As String 'Array of resource names (recipients)

Dim PeriodStart As Date 'Date when you want to start book resources
Dim PeriodEnd As Date 'Date when you want to stop booking resources

Dim AppStart As Date 'Start of a randomly generated appointment
Dim AppEnd As Date 'End of that appointment
Dim NextDay As Date 'Used for date calculations

'All duration and offset units are hours
Dim MinDuration As Single 'Minimum appointment duration
Dim MaxDuration As Single 'Maximum appointment duration

Dim MinOffset As Integer 'Minimum time til next appointment
Dim MaxOffset As Integer 'Maximum time til next appointment

Dim i As Integer 'Counter

Dim Offset As Integer 'Calculated offset til next appointment
Dim Duration As Integer 'Calculated appointment duration

On Error GoTo eh 'Set up error handling

'Define meeting rooms
Rcps(0) = "Room Arbutus"
Rcps(1) = "Room Balsa"
Rcps(2) = "Room Beech"
Rcps(3) = "Room Cedar"
Rcps(4) = "Room Cherry"
Rcps(5) = "Room Fir"
Rcps(6) = "Room Hemlock"
Rcps(7) = "Room Madrone"
Rcps(8) = "Room Oak"
Rcps(9) = "Room Willow"

PeriodStart = DateSerial(2007, 1, 15)
PeriodEnd = DateAdd("m", 6, PeriodStart) 'Going to add 6 months worth of
appointments

MinDuration = 0.5 'hours
MaxDuration = 12

MinOffset = 0
MaxOffset = 6


'for each resource
For i = 0 To 9
AppStart = PeriodStart
AppEnd = PeriodStart

Do While AppStart PeriodEnd

Duration = 30 * Int((CInt(2 * MaxDuration) - CInt(2 * MinDuration)
+
1) * Rnd * Rnd * Rnd + CInt(2 * MinDuration))
Offset = 60 * Int((MaxOffset - MinOffset + 1) * Rnd + MinOffset)

'Make sure appointment starts no earlier than 0800 or later than
2030
'and that it doesn't occur on a weekend
AppStart = DateAdd("n", Offset, AppEnd)

If AppStart DateAdd("h", 20.5, DateSerial(Year(AppStart),
Month(AppStart), Day(AppStart))) Then
NextDay = DateAdd("d", 1, DateSerial(Year(AppStart),
Month(AppStart), Day(AppStart)))
AppStart = DateAdd("h", 8, NextDay)
ElseIf Hour(AppStart) 8 Then
AppStart = DateAdd("h", 8, DateSerial(Year(AppStart),
Month(AppStart), Day(AppStart)))
AppStart = DateAdd("n", Offset, AppStart)
End If

If Weekday(AppStart, vbMonday) 5 Then 'move to next week
AppStart = DateAdd("d", 2, DateSerial(Year(AppStart),
Month(AppStart), Day(AppStart)))
AppStart = DateAdd("h", 8, AppStart)
AppStart = DateAdd("n", Offset, AppStart)
End If

AppEnd = DateAdd("n", Duration, AppStart)
If Weekday(AppEnd, vbMonday) vbFriday Then 'end today
AppEnd = DateSerial(Year(AppEnd), Month(AppEnd), Day(AppEnd))
AppEnd = DateAdd("h", 21, AppEnd)
End If

If AppEnd DateAdd("h", 21, DateSerial(Year(AppEnd),
Month(AppEnd),
Day(AppEnd))) Then
AppEnd = DateAdd("h", 21, DateSerial(Year(AppEnd),
Month(AppEnd), Day(AppEnd)))
End If


Duration = DateDiff("n", AppStart, AppEnd)

BookResource Rcps(i), AppStart, Duration

Debug.Print j & ", " & Rcps(i) & ", " & AppStart & ", " & AppEnd &
", " & Duration

Loop
Next


'Quit procedure
Exit Sub

'Error handler
eh:
MsgBox "Error : " & Err.Number & ", " & Err.Description
Resume Next

End Sub


Sub BookResource(Rcp As String, AppStart As Date, Duration As Integer)

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

On Error GoTo eh

Set oItm = oApp.CreateItem(olAppointmentItem)

'Define the item as a meeting and set other attributes
oItm.MeetingStatus = olMeeting

Select Case Duration
Case 0 To 60
oItm.Subject = "Short Meeting"
Case 61 To 1440
oItm.Subject = "Long Meeting"
Case Else
oItm.Subject = "Very Long Meeting"
End Select

oItm.Location = Rcp
oItm.Start = AppStart
oItm.Duration = Duration

'Add recipient
oItm.Resources = Rcp

'Define recipient as a resource


oItm.Save
oItm.Send

'Clean up objects
Set oItm = Nothing
Set oApp = Nothing

'Quit procedure
Exit Sub

'Error handler
eh:
MsgBox "Error : " & Err.Number & ", " & Err.Description

End Sub



Tadwick January 16th 07 05:00 AM

Outlook 2007/Exchange 2003 error when creating multiple items
 
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.




"Ken Slovak - [MVP - Outlook]" wrote:

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?

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Tadwick" wrote in message
...
Hi Ken,

Thanks for all those suggestions. I tried all the coding suggestions but
to
no avail. I also tried applying the latest service pack and changing the
server registry settings following
http://technet.microsoft.com/en-us/l.../aa997175.aspx (ie Max RPC Calls
Outstanding (500) , Gateway In Threads (2) and Gateway Out Threads (2) -
hopefully this was right).

Here's my code - maybe I haven't followed your suggestions on assigning
variables properly.
------------------------------------------------------------
Option Explicit

Sub BookResources()
'************************************************* **********
'Purpose is to book several resources programmatically
'
'Approach is to create an appointment item with Outlook object
'model and send to the resource mailbox.
'
'Environment is XP Pro SP2 w/OL2007, Windows Server 2003
'w/Exchange Server 2003 SP2
'
'Prerequisites are resource mailboxes created as windows
'accounts with calendar options set to accept all meeting
'requests and author permissions granted to client account
'************************************************* **********

Dim Rcps(10) As String 'Array of resource names (recipients)

Dim PeriodStart As Date 'Date when you want to start book resources
Dim PeriodEnd As Date 'Date when you want to stop booking resources

Dim AppStart As Date 'Start of a randomly generated appointment
Dim AppEnd As Date 'End of that appointment
Dim NextDay As Date 'Used for date calculations

'All duration and offset units are hours
Dim MinDuration As Single 'Minimum appointment duration
Dim MaxDuration As Single 'Maximum appointment duration

Dim MinOffset As Integer 'Minimum time til next appointment
Dim MaxOffset As Integer 'Maximum time til next appointment

Dim i As Integer 'Counter

Dim Offset As Integer 'Calculated offset til next appointment
Dim Duration As Integer 'Calculated appointment duration

On Error GoTo eh 'Set up error handling

'Define meeting rooms
Rcps(0) = "Room Arbutus"
Rcps(1) = "Room Balsa"
Rcps(2) = "Room Beech"
Rcps(3) = "Room Cedar"
Rcps(4) = "Room Cherry"
Rcps(5) = "Room Fir"
Rcps(6) = "Room Hemlock"
Rcps(7) = "Room Madrone"
Rcps(8) = "Room Oak"
Rcps(9) = "Room Willow"

PeriodStart = DateSerial(2007, 1, 15)
PeriodEnd = DateAdd("m", 6, PeriodStart) 'Going to add 6 months worth of
appointments

MinDuration = 0.5 'hours
MaxDuration = 12

MinOffset = 0
MaxOffset = 6


'for each resource
For i = 0 To 9
AppStart = PeriodStart
AppEnd = PeriodStart

Do While AppStart PeriodEnd

Duration = 30 * Int((CInt(2 * MaxDuration) - CInt(2 * MinDuration)
+
1) * Rnd * Rnd * Rnd + CInt(2 * MinDuration))
Offset = 60 * Int((MaxOffset - MinOffset + 1) * Rnd + MinOffset)

'Make sure appointment starts no earlier than 0800 or later than
2030
'and that it doesn't occur on a weekend
AppStart = DateAdd("n", Offset, AppEnd)

If AppStart DateAdd("h", 20.5, DateSerial(Year(AppStart),
Month(AppStart), Day(AppStart))) Then
NextDay = DateAdd("d", 1, DateSerial(Year(AppStart),
Month(AppStart), Day(AppStart)))
AppStart = DateAdd("h", 8, NextDay)
ElseIf Hour(AppStart) 8 Then
AppStart = DateAdd("h", 8, DateSerial(Year(AppStart),
Month(AppStart), Day(AppStart)))
AppStart = DateAdd("n", Offset, AppStart)
End If

If Weekday(AppStart, vbMonday) 5 Then 'move to next week
AppStart = DateAdd("d", 2, DateSerial(Year(AppStart),
Month(AppStart), Day(AppStart)))
AppStart = DateAdd("h", 8, AppStart)
AppStart = DateAdd("n", Offset, AppStart)
End If

AppEnd = DateAdd("n", Duration, AppStart)
If Weekday(AppEnd, vbMonday) vbFriday Then 'end today
AppEnd = DateSerial(Year(AppEnd), Month(AppEnd), Day(AppEnd))
AppEnd = DateAdd("h", 21, AppEnd)
End If

If AppEnd DateAdd("h", 21, DateSerial(Year(AppEnd),
Month(AppEnd),
Day(AppEnd))) Then
AppEnd = DateAdd("h", 21, DateSerial(Year(AppEnd),
Month(AppEnd), Day(AppEnd)))
End If


Duration = DateDiff("n", AppStart, AppEnd)

BookResource Rcps(i), AppStart, Duration

Debug.Print j & ", " & Rcps(i) & ", " & AppStart & ", " & AppEnd &
", " & Duration

Loop
Next


'Quit procedure
Exit Sub

'Error handler
eh:
MsgBox "Error : " & Err.Number & ", " & Err.Description
Resume Next

End Sub


Sub BookResource(Rcp As String, AppStart As Date, Duration As Integer)

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

On Error GoTo eh

Set oItm = oApp.CreateItem(olAppointmentItem)

'Define the item as a meeting and set other attributes
oItm.MeetingStatus = olMeeting

Select Case Duration
Case 0 To 60
oItm.Subject = "Short Meeting"
Case 61 To 1440
oItm.Subject = "Long Meeting"
Case Else
oItm.Subject = "Very Long Meeting"
End Select

oItm.Location = Rcp
oItm.Start = AppStart
oItm.Duration = Duration

'Add recipient
oItm.Resources = Rcp

'Define recipient as a resource


oItm.Save
oItm.Send

'Clean up objects
Set oItm = Nothing
Set oApp = Nothing

'Quit procedure
Exit Sub

'Error handler
eh:
MsgBox "Error : " & Err.Number & ", " & Err.Description

End Sub




Ken Slovak - [MVP - Outlook] January 16th 07 03:09 PM

Outlook 2007/Exchange 2003 error when creating multiple items
 
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.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Tadwick" wrote in message
...
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.



Brian Scheele February 23rd 07 06:21 PM

Outlook 2007/Exchange 2003 error when creating multiple items
 
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


"Ken Slovak - [MVP - Outlook]" wrote:

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.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Tadwick" wrote in message
...
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?




Tadwick February 23rd 07 06:33 PM

Outlook 2007/Exchange 2003 error when creating multiple items
 
Brian - thanks for letting me know


"Brian Scheele" wrote:

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


"Ken Slovak - [MVP - Outlook]" wrote:

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.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Tadwick" wrote in message
...
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?





All times are GMT +1. The time now is 06:51 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-2006 OutlookBanter.com