Domino Code Fragment

Code Name*
Export to Excel
Date*
08/17/2000
Source (or email address if you prefer)*
Anonymous
IP address:.199.90.101.212
Description*
Will export view to excel and format excel sheet
Type*
LotusScript
Categories*
File Input/Output
Implementation:
Modify constants
Required Client:
(none)
Server:
(none)
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
Sub Initialize
Dim filename As String
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim dc As NotesDocumentCollection
Dim CurrDoc As NotesDocument

Dim xlApp As Variant
Dim xlsheet As Variant

Set db = Session.currentdatabase
Set View = db.GetView( "By Facility" )
Set ws = New NotesUIWorkspace

filename = Inputbox$ ("Enter the complete Drive\Path\FileName.XLS for the docs to be exported.", "Enter Export File Information" ,"C:\THActions.XLS")
If filename = "" Then
Exit Sub
End If

Set xlApp = CreateObject("Excel.application")
Watch = "No"
If Watch = "Yes" Then YesNo = True Else YesNo = False
xlApp.Visible = YesNo

xlApp.Workbooks.add
Set xlsheet = xlApp.Workbooks(1).Worksheets(1)
xlsheet.Activate
xlsheet.Name = "Child Day Care Center Old Data"
' Build Header Row for Excel Spreadsheet

ARangeValue = xlsheet.Range("A1").Activate
xlsheet.Range("A" & Trim(Str(i + 1))).Value = "Facility Name"
xlsheet.Range("B" & Trim(Str(i + 1))).Value = "Facility Type"
xlsheet.Range("C" & Trim(Str(i + 1))).Value = "Street"
xlsheet.Range("D" & Trim(Str(i + 1))).Value = "City"
xlsheet.Range("E" & Trim(Str(i + 1))).Value = "zip"
xlsheet.Range("F" & Trim(Str(i + 1))).Value = "Phone Number"

' Build Document Collection for Export:
Set dc = db.UnprocessedDocuments

' Export Data
Set CurrDoc = dc.GetFirstDocument