"Variant Does not contain an Object" error whileexecuting the OOO script for Editor Level User---Urgent please

I a trying to run the below script through button…Receving the error “Variant does not contain an object”…Pl…Suggest.

Dim AdminRequest As Variant

Set AdminRequest = session.CreateAdministrationProcess(“GorkyPark/Moscow”)

UserName = “Ninochka”

AgentActivatable = True

Agent = “DemoAgent”

If Not(agent.IsEnabled) Then

Call AdminRequest.ConfigureMailAgent(UserName, Agent, AgentActivatable, False)

Elseif

Call AdminRequest.ConfigureMailAgent(UserName, Agent, AgentActivatable, True)

Need to give the button for all the users in the organization. We are reducing user access level to “Editor”. We are using cutomized mail template.

Pl.suggest immediately.

Note:Can anyone plaese share with me E-Mail address o Julie Kadashevich?

Subject: “Variant Does not contain an Object” error whileexecuting the OOO script for Editor Level User—Urgent please

Thank you very much for response…

This line is causing the error…

Set AdminRequest = session.CreateAdministrationProcess(“GorkyPark/Moscow”)

Subject: RE: “Variant Does not contain an Object” error whileexecuting the OOO script for Editor Level User—Urgent please

My bet is that

session

was never instantiated (nor for that matter, declared)

Subject: “Variant Does not contain an Object” error whileexecuting the OOO script for Editor Level User—Urgent please

http://whois.ibm.com

You could at least have provided us with the info, which line causes the error. I sure have an idea, but don’t feel like trying it out myself. And: Use the debugger.

Subject: ““OOO_Agent:Initialize : 17:Not a member:GETAGENT”” error whileexecuting the OOO script for Editor Level User—Urgent please

Thanks a lot for correction…

Plsee the code now…While trying to save …getting the error “OOO_Agent:Initialize : 17:Not a member:GETAGENT”

Sub Initialize

Dim session As New NotesSession

Dim enabled As String

Dim adminp As NotesAdministrationProcess

Dim agent As NotesAgent

Dim userName As Variant

Dim workspace As New NotesUIWorkspace

Dim db As NotesUIDatabase

Set adminp = session.CreateAdministrationProcess(“mailserver1/trial”)

userName = “Padma Latha”

Set db = workspace.CurrentDatabase

Set agent = db.GetAgent(“OutOfOffice”)

'Check if the OutOfOffice agent is enabled

enabled$ = Str(agent.IsEnabled)

If Not agent.isenabled Then

Call Adminp.ConfigureMailAgent(UserName, Agent, True, False)

Else

Call Adminp.ConfigureMailAgent(UserName, Agent, True, True)

End If

End Sub

Subject: Latest Code–No Error while saving and executng–Pl.go through the code for corrections-Set Allow User Activation for Edtor access Users

Pl.suggest the changes

Sub Initialize

        Dim session As New NotesSession 

        Dim enabled As String 

        Dim adminp As NotesAdministrationProcess 

        Dim ws As New NotesUIWorkspace 

        Const agentName = "OutOfOffice"

        Dim userName As Variant 

        Dim db As NotesDatabase 

        

        Set adminp = session.CreateAdministrationProcess("mailserver1/trial") 

        

        userName = "Padma Latha"

        

        Set db = session.CurrentDatabase 

        

        Forall a In db.Agents

                    If a.Name = agentName Then

        'Check if the OutOfOffice agent is enabled 

                                If Not a.IsEnabled Then 

                                            Call Adminp.ConfigureMailAgent(UserName, agentName, True, False) 

                                Else  

                                            Call Adminp.ConfigureMailAgent(UserName, agentName, True, True) 

                                            

                                End If    

                                Exit Sub

                    End If                            

        End Forall         

End Sub