"Out of Memory" error in Lotus Notes automation from VBA

Posted by PowerUser on Stack Overflow See other posts from Stack Overflow or by PowerUser
Published on 2010-04-27T13:39:25Z Indexed on 2010/04/27 13:43 UTC
Read the original article Hit count: 285

Filed under:
|

This VBA function sporadically fails with a Notes automation error "Run-Time Error '7' Out of Memory". Naturally, when I try to manually reproduce it, everything runs fine.

Function ToGMT(ByVal X As Date) As Date
    Static NtSession As NotesSession
    If NtSession Is Nothing Then
        Set NtSession = New NotesSession
        NtSession.Initialize
    End If
(do stuff)
End function

To put this in context, this VBA function is being called by an Access query, 3-4 times per record, with 20,000 records. For performance reasons, the NotesSession has been made static. Any ideas why it is sporadically giving an out-of-memory error?

(Also, I'm initiating the NotesSession just so I can convert a datetime to GMT using Lotus's rules. If you know a better way, I'm listening).

© Stack Overflow or respective owner

Related posts about lotus-notes

Related posts about vba