Business user request to export the data from web to excel.when they click on export button, the export agent runs and bring all data to excel thereafter open the exported excel file for user to save…
but i tried many times, it fails… the server is running on unix platform…
below is my sample code, i was using “print” to debug, and found “9090909090-12” cannot be displayed. think unix server does not support createObject method…
This function working fine in localhost or lotus notes client…
Does anybody help me with this? how to meet the this requirement?
Thanks a lot.
Sub Initialize
Dim session As NotesSession
Dim db As NotesDatabase
Dim vw As NotesView
Dim doc As NotesDocument
Dim dc As NotesDocumentCollection
Dim curDoc As NotesDocument
Dim ec As NotesViewEntryCollection
Dim entry As NotesViewEntry
Dim strDelimiter As String
Dim fileHandle List As Integer
Dim fileName As String
Print "9090909090-1"
'Set up the Excel application
Dim xlApp As Variant
Dim xlSheet As Variant
Dim sheetcount As Integer
Dim rownum As Long
Dim title As String
Dim flag As String
Print "9090909090-11"
Set xlApp = CreateObject("Excel.application")
Print "9090909090-12"
xlApp.Workbooks.Add
xlApp.Workbooks(1).Sheets.Add
xlApp.Workbooks(1).Sheets.Add
Set session = New NotesSession
Set curDoc = session.DocumentContext
Set db = session.CurrentDatabase
Set vw = db.GetView("Secname")
strDelimiter = " "
'View data
sheetcount = 1
Set xlSheet = xlApp.Workbooks(1).Sheets(sheetcount)
'heading
With xlSheet
rownum = rownum + 1
.Cells(rownum, 1).Value = "Subjects"
.Cells(rownum, 2).Value = "Publisher"
.Cells(rownum, 3).Value = "Book Title"
.Rows(rownum).VerticalAlignment = 1
End With
rownum = rownum + 1
With xlSheet
.Cells(rownum, 1).Value = "haha"
.Cells(rownum, 2).Value = "xixi"
End With
Dim x As Integer
For x = sheetcount+1 To xlApp.Workbooks(1).Sheets.count
Set xlSheet = xlApp.Workbooks(1).Sheets(x)
If Not xlSheet Is Nothing Then xlSheet.Visible = False
Next
xlApp.Visible = True
End sub