Scheduled Agents and OLE
Currently, I have a client who maintains a excel spreadsheet located on a network drive. This spreadsheet contains a number of graphs. The client copied these graphs into a Lotus Notes Document and pasted them using a OLE so that everytime someone opens the document it prompt the person to update the data. If the person says yes, it goes and gets the latest data. The issue is this database is also BROWSED (not editted) via web browsers and the client want those looking at the information could be seeing out of date data. What they would like to happen is have a schedule agent run once an hour update the graphs (if they've changed) and save and close the document. This would also allow the people even using Lotus Notes say NO as it can take a few minutes to update all the graphs. Is this possible? I've setup an agent that maps the network drive on the server and is signed by an unrestrited ID. The agent works fine when I run it. However, when run in the background the log just gives the following "error" which doesn't help a lot: AMgr: Agent ('Update v2' in 'test.nsf') error message: Error creating product object The code looks like this (this is just to test the idea): Sub OLERefresh Dim s As New NotesSession Dim db As NotesDatabase Dim dc As NotesDocumentCollection Dim doc As NotesDocument Dim uidoc As NotesUIDocument Dim sstring As String Print " v2 this is a test message " Set db = s.CurrentDatabase sstring = |MarkFlag="SMC"| Set dc = db.Search(sstring,Nothing,0) If dc.count = 1 Then Print "v2: Before Mapping" drive = "S" serverName = "servernameshared" userName = "domainmynetworkID" userPwd = "password" Print "net use "+drive+": "+serverName+" /user:"+userName + " "+userPwd returnvalue = Shell( "net use "+drive+": "+serverName+" /user:"+userName + " "+userPwd ) Print "v2: Drive mapped" Set doc = dc.GetFirstDocument Set uidoc = ws.editdocument(True,doc) Call uidoc.Refresh Call uidoc.Save Call uidoc.Close Print "v2: Drop Drive" returnvalue = Shell( "net use "+drive+": /delete" ) End If Print "v2: Done" End Sub

Software/Hardware used:
ASKED: June 6, 2006  3:47 PM
UPDATED: June 6, 2006  4:46 PM

Answer Wiki:
"Error creating product object" occurs if you use a front end class in a scheduled agent. See if you can write the agent using only backend classes.
Last Wiki Answer Submitted:  June 6, 2006  4:46 pm  by  Brooklynegg   3,845 pts.
All Answer Wiki Contributors:  Brooklynegg   3,845 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _