Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Erorr with Lotus notes "CreateObject("Notes.Notesuiworkspace")"

Status
Not open for further replies.

KM8888

Programmer
Nov 21, 2011
69
US
There's a strange error occurring but it's only happening to some users and not others. They're all running the same OS and same lotus notes version.

It's prompting an error on this line

Set notesuiworkspace = CreateObject("Notes.Notesuiworkspace")

The only thing the error says is:

Error in script on line xx.

Doesn't indicate anything else... Any ideas would be appreciated, thanks!
 
How are you executing the script? Is there error trapping in the script? Can you post the script?
 
Hi guitarzan, thanks for replying. That's actually the first thing the script is doing so it's tripping right at the start, it's being executed through the PCOMM environment as a .mac file, written in vbscript. I might be able to generate a better worded error if I have the user run the script in a .vbs, it's just a bit frustrating that I can't recreate the error. When they were getting the error I decided to put error trapping around it but it just doesn't execute properly after that because it can't seem to create the workspace object
 
Yes, the script should not continue executing if the CreateObject fails. So, you should trap the error, display a message and quit; This is how I would do it, but I don't know if this code will work in your environment:
Code:
[COLOR=blue]On Error Resume Next[/color]
Set notesuiworkspace = CreateObject("Notes.Notesuiworkspace")
[COLOR=blue]If Err.Number <> 0 Then
   wscript.echo "Got Error# " & Err.Number & ": " & Err.Description
   wscript.quit
End If
On Error Goto 0[/color]
 
I'm new to this forum and this is my first post. Let me venture a response. I theorize that for users that experience the error, Lotus Notes the application is already open. So it is already instantiated and CreateObject will not work. In this case I would try GetObject instead.
Code:
Set notesuiworkspace = GetObject("","Notes.Notesuiworkspace")

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top