Skip to main content
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 4 and 5 Forum

Notes/Domino 4 and 5 Forum

developerWorks

  

Sign in to participate PreviousPrevious NextNext

export to excelsheet-whats wrong in my code??
koneru lata 20.Jun.05 08:08 AM a Web browser
Domino Designer -- LotusScript 5.0.1 Solaris

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)
. . RE: export to excelsheet-whats wron... (JC Warren 20.Jun.05)
. . RE: export to excelsheet-whats wron... (Doug Finner 20.Jun.05)
. . . . RE: export to excelsheet-whats wron... (koneru lata 21.Jun.05)
. . . . . . RE: export to excelsheet-whats wron... (Stan Rogers 21.Jun.05)
. . RE: export to excelsheet-whats wron... (koneru lata 22.Jun.05)






  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Author
Category
Platform
Release
Advanced search

 Sign In or Register
Sign in
Forgot your password?
Forgot your user name?
Create new registration

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

  Lotus Support
Lotus Support
Product support pages index
Search knowledge base (Technotes)
Search support downloads
Lotus Support RSS

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
Notes/Domino 4 and 5
IBM Connections
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
IBM SmartCloud Meetings
IBM Web Content Manager
Lotus Domino Document Manager
Lotus e-learning
Lotus Enterprise Integration
Lotus Expeditor
Lotus Protector
Lotus Quickr
Lotus SmartSuite
Lotus Symphony
Lotus Symphony Developer Toolkit Support
Lotus Workflow