Hi, I am able to export data from view to Excel through agent (Lotus Script). Am I able to perform the same task on the web? I have tried to run it on the web, but it shows “Operation is disallowed in this session”. Can anyone please give some advice?
Below is the script in the agent.
Dim x As Integer
Dim y As Integer
Dim strLen As Integer
Dim ws As NotesUIWorkspace
Dim vw As NotesUIView
Dim coldocs As NotesDocumentCollection
Dim doc As NotesDocument
Dim it As Variant
Dim strDesc As String
Dim strTrack As String
Set ws = New NotesUIWorkspace
Set vw = ws.CurrentView
Set coldocs = vw.Documents
Set doc = coldocs.getfirstdocument
Print "1"
’ Set up the Excel Application
Dim xlApp As Variant
Dim xlSheet As Variant
Print "2"
Set xlApp = CreateObject("Excel.Application")
Print "3"
orgchart$ = "C:\Staff Details.xls"
Print "4"
Set xlSheet = xlApp.Workbooks.Open(orgchart$)
Print "5"
xlSheet.ActiveSheet.Cells(1, 1) = "No."
xlSheet.ActiveSheet.Cells(1, 2) = "Emp's Name"
’ Format columns
’ This sets the col width
xlSheet.ActiveSheet.Columns(1).ColumnWidth = 4
xlSheet.ActiveSheet.Columns(2).ColumnWidth =33
For i = 1 To 2
xlSheet.ActiveSheet.Columns(i).VerticalAlignment = 1
Next
’ Set Page Orientation
xlSheet.ActiveSheet.PageSetup.Orientation = 2
’ Underline the headings
For i = 1 To 2
xlSheet.ActiveSheet.Cells(1, i).Font.Underline = 2
Next
’ Set the 3rd row to be the title row
xlSheet.ActiveSheet.PageSetup.PrintTitleRows = "$1:$1"
x=3
Do While Not doc Is Nothing
xlSheet.ActiveSheet.Cells(x, 2).value = doc.Emp_Name(0)
x = x + 1
Set doc=coldocs.GetNextDocument(doc)
Loop
xlApp.Visible = True