Question & Answer
When the LotusScript CreateObject function is executed repeatedly on a Lotus® Domino® server, the function will sometimes fail with the following error:
- "Cannot create automation object."
This issue occurs when using the LotusScript RunOnServer method to execute the agent containing the CreateObject call. The issue has not been observed with scheduled agents.
The log entry will look similar to the below:
- "Addin: Agent '<agent name>' error message: Cannot create automation object"
In some cases, the function call began to work again once the user presses the F5 key to close the user's session. In other cases, the additional calls have started to work without closing the session.
Steps to Reproduce:
1. In a database on a Domino server, create the two agents below. The first agent should be named "AgentOne". If you have Microsoft Word 2000 installed on the server use the agent as coded below. If you have Lotus 1-2-3 installed, remark out the first CreateObject call and remove the remark comment from the second CreateObject line.
- Dim o As Variant
Set o = CreateObject("Word.application.9")
' or if you have 1-2-3 installed on the server
2. Create an agent that executes the above agent:
Dim sess As New NotesSession
Dim agent As NotesAgent
Set agent = sess.CurrentDatabase.GetAgent("AgentOne")
3. Now execute the second agent repeatedly. Check the server's log for the error "Cannot create automation object".
This issue was reported to Quality Engineering as SPR# PJAN4LSNXM. There are no plans to address the issue.
To work around the issue, you can call a different agent on the server, which in turn will call the agent doing OLE using the .run method. It appears that this issue occurs only when the agent doing OLE is called by the "RunOnServer" method.
The error code associated with the "Cannot create automated object" error is 208, which does not appear by default. If an agent has been customized to include additional error information using the Err function, then the error number 208 will be returned.
Internal Use Only
Contributor: Matt Garoian, per tech review.
During the Tech Review of this technote, the below CreateObject call was used. Not sure if it's a default Windows 2000 App or not, so didn't use it in the technote example:
- Set o=CreateObject("PCXImage.Document")
|PJAN4LSNXM||Notes SPR System|
|AMOR4P4QET||Notes SPR System|
Lotus Notes Client
16 June 2018