Skip to main content
This forum is closed to new posts and responses. New discussions are now taking place in the IBM Developer Answers forum.
 
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 6 and 7 Forum

Notes/Domino 6 and 7 Forum

developerWorks

  

PreviousPrevious NextNext


Alex Harris 25.Oct.06 06:03 PM a Web browser
Notes Client 6.0.2 CF2 All Platforms


I have the following code in an agent that exports documents to Excel. I am getting an OLE Automation error when the following part of the code runs, however, if I delete the columns in my view that are dates, the code works perfectly. Do you know how I can change the bit of code below to accept dates? Thanks.

'Code that's producing OLE Automation Error
Add row data from the documents
row=2
Set docX=v.GetFirstDocument
While Not docX Is Nothing
col=1
Forall cValue In docX.ColumnValues
xlWbk.ActiveSheet.Cells(row, col)=cValue
col=col+1
End Forall
row=row+1
Set docX=v.GetNextDocument(docX)
Wend
_________________________________________________

'Entire Code
Sub Initialize
Dim WS As notesuiworkspace
Dim UiView As notesuiview
Dim ViewString As String
Dim session As NotesSession
Dim db As NotesDatabase
Dim v As NotesView
Dim docX As NotesDocument
Dim col As Integer
Dim row As Double
Dim xl As Variant
Dim xlWbk As Variant
Dim pagename As String

Set WS = New notesuiworkspace
Set session = New notessession
Set db=session.CurrentDatabase

Print "Please Be Patient as the Excel Spreadsheet is being created..."

' Get dynamic view name, R5 only
' Take this part out if using in R4, you have to hard-code the name of the view in ViewString
Set UiView=WS.currentview
ViewString=UiView.viewname

Set v=db.GetView("Export")

' Create Excel Sheet
Set xl=CreateObject("Excel.Application")
Set xlWbk=xl.Workbooks.Add

' Add column headings to first row
col=1
Forall vColumn In v.Columns
xlWbk.ActiveSheet.Cells(1, col)=vColumn.Title
col=col+1
End Forall

' Add row data from the documents
row=2
Set docX=v.GetFirstDocument
While Not docX Is Nothing
col=1
Forall cValue In docX.ColumnValues
xlWbk.ActiveSheet.Cells(row, col)=cValue
col=col+1
End Forall
row=row+1
Set docX=v.GetNextDocument(docX)
Wend

' Make all columns fit
xlWbk.ActiveSheet.Columns.AutoFit

Print "Excel Document Successfully Created!"

' Open it up in Excel
xl.Visible=True
End Sub






OLE Automation Error (Alex Harris 25.Oct.06)
. . RE: OLE Automation Error (phani kiran 26.Oct.06)
. . . . RE: OLE Automation Error (Alex Harris 26.Oct.06)





  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

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

Resources

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support

 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds

Wikis

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Connections Cloud Developers
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


 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
IBM Connections
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
Lotus Enterprise Integration
Lotus Protector
Lotus Quickr
Lotus SmartSuite