473,326 Members | 2,148 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Error after 380 CreateObject("MAPI.Session")

Error: 80040108 after 380 CreateObject("MAPI.Session")

Function MAPI_Test2()
Dim i As Integer
Dim MySession As MAPI.Session

i = 0
While (i < 2000)
Set MySession = CreateObject("MAPI.Session")
Debug.Print i
i = i + 1
Set MySession = Nothing
DoEvents
Wend
End Function

Any ideas?

Best regards
Ottar
Nov 13 '05 #1
4 5004
You are Dim'ing MySeesion as MAPI.Session which you cannot do without
setting a reference. If you want to use early binding, set a reference. If
you want to use late binding, change your code to:

Dim MySession As Object

It should run fine, if you do that.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

"Ottar" <la*****@earthling.net> wrote in message
news:43*************************@posting.google.co m...
Error: 80040108 after 380 CreateObject("MAPI.Session")

Function MAPI_Test2()
Dim i As Integer
Dim MySession As MAPI.Session

i = 0
While (i < 2000)
Set MySession = CreateObject("MAPI.Session")
Debug.Print i
i = i + 1
Set MySession = Nothing
DoEvents
Wend
End Function

Any ideas?

Best regards
Ottar

Nov 13 '05 #2
No success unfornunatly, tried Dim MySession As Object same thing happens.

The code:
Dim MySession As MAPI.Session
Set MySession = CreateObject("MAPI.Session")

Is taken directly from Microsoft MSDN articles.

Any other suggestions? Could you try it on your PC? I've tried it on 3 PC's
with same result.

Best regards

Ottar

"Arvin Meyer" <a@m.com> wrote in message
news:#3**************@TK2MSFTNGP09.phx.gbl... You are Dim'ing MySeesion as MAPI.Session which you cannot do without
setting a reference. If you want to use early binding, set a reference. If
you want to use late binding, change your code to:

Dim MySession As Object

It should run fine, if you do that.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

"Ottar" <la*****@earthling.net> wrote in message
news:43*************************@posting.google.co m...
Error: 80040108 after 380 CreateObject("MAPI.Session")

Function MAPI_Test2()
Dim i As Integer
Dim MySession As MAPI.Session

i = 0
While (i < 2000)
Set MySession = CreateObject("MAPI.Session")
Debug.Print i
i = i + 1
Set MySession = Nothing
DoEvents
Wend
End Function

Any ideas?

Best regards
Ottar


Nov 13 '05 #3
No success unfornunatly, tried Dim MySession As Object; same thing happens.

The code:
Dim MySession As MAPI.Session
Set MySession = CreateObject("MAPI.Session")
Is taken directly from Microsoft MSDN articles.

Any other suggestions? Could you try it on your PC? I've tried it on 3 PC's
with same result.

Best regards

Ottar

"Arvin Meyer" <a@m.com> wrote in message news:<#3**************@TK2MSFTNGP09.phx.gbl>... You are Dim'ing MySeesion as MAPI.Session which you cannot do without
setting a reference. If you want to use early binding, set a reference. If
you want to use late binding, change your code to:

Dim MySession As Object

It should run fine, if you do that.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

"Ottar" <la*****@earthling.net> wrote in message
news:43*************************@posting.google.co m...
Error: 80040108 after 380 CreateObject("MAPI.Session")

Function MAPI_Test2()
Dim i As Integer
Dim MySession As MAPI.Session

i = 0
While (i < 2000)
Set MySession = CreateObject("MAPI.Session")
Debug.Print i
i = i + 1
Set MySession = Nothing
DoEvents
Wend
End Function

Any ideas?

Best regards
Ottar

Nov 13 '05 #4
"Ottar L. Osen" <la*************@earthling.net> wrote in message
news:O3**************@TK2MSFTNGP12.phx.gbl...
No success unfornunatly, tried Dim MySession As Object same thing happens.

The code:
Dim MySession As MAPI.Session
Set MySession = CreateObject("MAPI.Session")

Is taken directly from Microsoft MSDN articles.

Any other suggestions? Could you try it on your PC? I've tried it on 3

PC's with same result.


I did try it on my PC, and it worked with the one change I showed.

I was able to generate 2000 counts in the debug window. Keep in mind that I
have a GB of memory, so I probably have enough to allocate to all those
instances of MAPI.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Fie Fie Niles | last post by:
I have IIS installed on XP Professional workstation machine. I have an ASP page that open connection to an Access database, then when trying to update the database, it gave me the error "cannot...
9
by: bajopalabra | last post by:
hi session("myVar") = rs.getRows( ) don't work when number of records is greater than 10 does anybody know WHY ??? is it a Session object limitation ??? thanks
7
by: Ottar | last post by:
I've made a program sorting incomming mail in public folder. The function runs every minute by using the form.timer event. In Access XP it runs for weeks, no problem. Access 2003 runs the same...
13
by: dee | last post by:
Hi My code complies the following line: Session("passed") = 1 but puts wiggly error line under the second Session("passed") in the following expression: Session("passed") = Session("passed") +...
10
by: thomson | last post by:
Hi, i create a session variable in C# as follows Session , but iam not able to access the variable in VB.net like intmode=Session("var"); Why is that ? Regards
3
by: Paul | last post by:
Hi All, In my application, I wished to check certain things on each page load, so rather than paste the same code in each pages constructor, I thought it would be more logical to inherit from...
0
by: PShark | last post by:
Hi I have a VB6 app that uses MAPI to send and receive emails. My users are able to use the app to send emails successfully, but when there are new emails in the mailbox, the program opens the email...
1
by: patelxxx | last post by:
Hi Guy's, I'm getting the error: "Username or password did not match" BEFORE I even enter a username and password, can someone help? 1) The site I'm accessing is:...
3
by: Kosmos | last post by:
Hey ya'll...I can't seem to figure out why I'm getting this error message, but it all started when I added the new line of code with the recSet5.AddNew --- when I ran the first line, the logic worked...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.