kindly let me why data is NOT exported to excelsheet, where is the error please??? the commented lines are giving error , pl. tell me why??
Thanks in advance its quite urgent!!!
Sub Click(Source As Button)
Dim workspace As New NotesUIWorkspace
Dim session As New NotesSession
Dim db As NotesDatabase
Set db=session.CurrentDatabase
Dim collection As NotesDocumentCollection
Set collection=db.UnprocessedDocuments
Dim view As NotesUIView
Set view=workspace.CurrentView
Dim view1 As notesview
Set view1=db.GetView("crew")
Dim doc, doc1 As NotesDocument
Dim j, m, m1, m2, m3, m4 As Integer
Dim r1, xlApp As Variant
'm=view1.ColumnCount
m1=2
Set xlApp=CreateObject("Excel.Application")
xlApp.Visible=True
xlApp.workbooks.add
Set doc=view1.GetFirstDocument
xlApp.ActiveSheet.Cells(1,1).Value="Seismic Acquisition Report for the date"& Ucase(session.GetEnvironmentString("doc.month_year"))
xlapp.ActiveSheet.Cells(1,1).Font.Size=10
xlApp.ActiveSheet.Cells(1,1).Font.Bold=True
xlApp.ActiveSheet.Cells(1,1).Font.Underline=True
xlApp.ActiveSheet.Cells(2,1).Value="Survey Type is "& Ucase(session.GetEnvironmentString("doc.typeofsurvey")) & " for Basin "& Ucase(session.GetEnvironmentString("doc.basin"))
xlapp.ActiveSheet.Cells(2,1).Font.Size=8
xlApp.ActiveSheet.Cells(2,1).Font.Bold=True
xlApp.ActiveSheet.Cells(2,1).Font.Italic=True
xlApp.ActiveSheet.Cells(2,1).Font.ColorIndex=3
xlApp.ActiveSheet.Cells(3,1).Value="Geophysical Field Party Nos"&Ucase(session.GetEnvironmentString("doc.gpnos"))
xlapp.ActiveSheet.Cells(3,1).Font.Size=8
xlApp.ActiveSheet.Cells(3,1).Font.Bold=True
xlApp.ActiveSheet.Cells(4,1).Value="S.No"
xlapp.ActiveSheet.Cells(4,1).Font.Size=7
xlApp.ActiveSheet.Cells(4,1).Font.Bold=True
xlApp.ActiveSheet.Cells(4,2).Value="Data Transmittal & Operational Status"
xlapp.ActiveSheet.Cells(4,2).Font.Size=7
xlApp.ActiveSheet.Cells(4,2).Font.Bold=True
xlApp.ActiveSheet.Cells(4,3).Value="Equipment, Vehicle repair"
xlapp.ActiveSheet.Cells(4,3).Font.Size=7
xlApp.ActiveSheet.Cells(4,3).Font.Bold=True
xlApp.ActiveSheet.Cells(4,4).Value="Work Program for crew"
xlapp.ActiveSheet.Cells(4,4).Font.Size=7
xlApp.ActiveSheet.Cells(4,4).Font.Bold=True
xlApp.ActiveSheet.Cells(4,5).Value="Adminstrative approval"
xlapp.ActiveSheet.Cells(4,5).Font.Size=7
xlApp.ActiveSheet.Cells(4,5).Font.Bold=True
xlApp.ActiveSheet.Cells(4,6).Value="Budget Allocation"
xlapp.ActiveSheet.Cells(4,6).Font.Size=7
xlApp.ActiveSheet.Cells(4,6).Font.Bold=True
xlApp.ActiveSheet.Cells(4,7).Value="Remarks"
xlapp.ActiveSheet.Cells(4,7).Font.Size=7
xlApp.ActiveSheet.Cells(4,7).Font.Bold=True
r = 1
row = 1
m2 = 6
x = 6
' While Not (doc Is Nothing)
m3 = 1
'For m3 = 1 To collection.Count
If m3 < 5 Then
xlApp.ActiveSheet.Cells(m2,1).Value=r
xlApp.ActiveSheet.Cells(m2,1).columnwidth=3
xlApp.ActiveSheet.Cells(m2,1).Font.Size=7
xlApp.ActiveSheet.Cells(m2,2).Value=data_operation_status
xlApp.ActiveSheet.Cells(m2,2).columnwidth=20
xlApp.ActiveSheet.Cells(m2,2).Font.Size=7
xlApp.ActiveSheet.Cells(m2,3).Value=quip_vehicle_repair
xlApp.ActiveSheet.Cells(m2,3).columnwidth=20
xlApp.ActiveSheet.Cells(m2,3).Font.Size=7
xlApp.ActiveSheet.Cells(m2,4).Value=work_program
xlApp.ActiveSheet.Cells(m2,4).columnwidth=20
xlApp.ActiveSheet.Cells(m2,4).Font.Size=7
xlApp.ActiveSheet.Cells(m2,5).Value=admin_approval
xlApp.ActiveSheet.Cells(m2,5).columnwidth=20
xlApp.ActiveSheet.Cells(m2,5).Font.Size=7
xlApp.ActiveSheet.Cells(m2,6).Value=budget_allocation
xlApp.ActiveSheet.Cells(m2,6).columnwidth=20
xlApp.ActiveSheet.Cells(m2,6).Font.Size=7
xlApp.ActiveSheet.Cells(m2,7).Value=remarks
xlApp.ActiveSheet.Cells(m2,7).columnwidth=30
xlApp.ActiveSheet.Cells(m2,7).Font.Size=7
m2 = m2 + 1
r = r + 1
m3 = m3 + 1
Set doc=view1.GetNextDocument(doc)
End If
' Next
' Wend
r=m2-1
rng1="A4:F" & Cstr(r)
xlApp.Range("A1:F1").Cells.Merge
xlApp.Range("A2:F2").Cells.Merge
xlApp.Range("A3:F3").Cells.Merge
xlApp.Range("A4:G20").Cells.WrapText=True
'xtApp.Range(rng1).Cells.Borders.ColorIndex=2
xlApp.Range("A4:G4").Cells.Interior.ColorIndex=15
rng="A1:F" & Cstr(r)
xlApp.Range(rng).Select
xlApp.ActiveSheet.name="view.CREW"
Set xlApp=Nothing
Set doc=Nothing
End Sub

export to excelsheet-whats wrong in... (koneru lata 20.Jun.05)
. . 