Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6131205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:56:49+00:00 2026-05-23T16:56:49+00:00

Sub Initialize ‘Copyright Botstation (www.botstation.com) Dim session As New NotesSession Dim wks As New

  • 0
Sub Initialize
    'Copyright Botstation (www.botstation.com)
    Dim session As New NotesSession
    Dim wks As New NotesUIWorkspace
    Dim db As NotesDatabase
    Dim view As NotesView
    Dim uiView As NotesUIView
    Dim doc As NotesDocument
    Dim column As NotesViewColumn

    Dim row As Long,colcounter As Long,arrcnt As Long,arrcounter As Long, x As Long
    Dim filename As String, currentvalue As String
    Dim rowsatonce As Integer,cn As Integer
    Dim xlApp As Variant, xlsheet As Variant,xlwb As Variant, xlrange As Variant, tempval As Variant
    Dim DataArray
    Dim VColumns List As String

    ReDim DataArray(0, 80) As String
    '80 columns is our expected max number of columns in the view. It's dynamically recomputed below to actual (lower) number. Change if the number of columns is larger.

    Set db=session.CurrentDatabase
    Set xlApp = CreateObject("Excel.Application")

    xlApp.Visible = True 'Excel program is visible (to avoid errors and see what is happening)

    Set xlwb=xlApp.Workbooks.Add
    Set xlsheet =xlwb.Worksheets(1)

    Set uiView = wks.CurrentView
    Set view = db.GetView( uiView.ViewName ) ' get the view currently open in UI
    arrcnt=0
    row=1
    colcounter=0
    rowsatonce=20
    ForAll c In view.Columns
        If c.isIcon<>True Then ' do not include icon columns
            If c.Formula<>"""1""" And c.Formula<>"1" Then 'do not include columns which are used for counting docs (Total)
                colcounter=colcounter+1
                DataArray(row-1, colcounter-1) =c.Title
                VColumns(CStr(cn))=CStr(cn)
            End If
        End If
        cn=cn+1
    End ForAll
    ReDim Preserve DataArray(0, colcounter-1) As String
    xlsheet.Range("A1").Resize(1, colcounter).Value = DataArray ' set column names
    ReDim DataArray(rowsatonce-1, colcounter-1) As String
    row=2
    x=0
    Set doc = view.GetFirstDocument
    While Not ( doc Is Nothing )
        ForAll col In VColumns
            currentvalue=""
            tempval= doc.ColumnValues(Val(col))
            If IsArray(tempval) Then
                ForAll v In tempval
                    If currentvalue="" Then
                        currentvalue=v
                    Else
                        currentvalue=currentvalue+","+v
                    End If
                End ForAll
            Else
                currentvalue=tempval
            End If
            x=x+1
            DataArray(arrcounter, x-1) =currentvalue
        End ForAll
        x=0
        row=row+1
        arrcounter=arrcounter+1
        If arrcounter/rowsatonce=arrcounter\rowsatonce And arrcounter<>0 Then
            xlsheet.Range("A"+Cstr(arrcnt*rowsatonce+2)).Resize(rowsatonce, colcounter).Value = DataArray
            arrcnt=arrcnt+1
            arrcounter=0
            ReDim DataArray(rowsatonce-1, colcounter-1) As String
        End If
        Set doc = view.GetNextDocument (doc)
    Wend

    If arrcounter/rowsatonce<>arrcounter\rowsatonce And arrcounter>0 Then
        ' Redim Preserve DataArray(arrcounter, colcounter-1) As String
        xlsheet.Range("A"+Cstr(arrcnt*rowsatonce+2)).Resize(arrcounter, colcounter).Value = DataArray
    End If
    MsgBox "Done"

End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:56:50+00:00Added an answer on May 23, 2026 at 4:56 pm

    Once you have got the month that you want to include you can add a condition after this line:

    While Not ( doc Is Nothing )
    

    Compare the month (and probably year) with the (date) item on the document. You might need the NotesDateTime class to do this.

    To filter the right month you can do this: (assuming you also need the year)

    If year(date1) * 100 + month(date1) = year(date2) * 100 + month(date3)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Private Sub Command1_Click() Dim dom As New DOMDocument Dim http As New XMLHTTP Dim
Private Sub Command1_Click() Dim x As Integer For x = 1 To 100 List1.AddItem
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress Dim allowedChars
I have classX: Sub New(ByVal item_line_no As String, ByVal item_text As String) ' check
I have this sub to initialize my logger: sub initLogfiles{ Log::Log4perl->easy_init($INFO); # We log
Take this sample code: Class Foo ReadOnly name As String Public Sub New(name As
Consider the following: Public Module Extensions <Extension()> _ Public Sub Initialize(ByRef Target as SomeClass,
I've got interface: Public Interface ICSIItem Sub Initialize() Event AnswerValueChanged(ByVal sender As Object, ByVal
I have an agent with the following code: Sub Initialize MessageBox AgentStart Print AgentStart
sub do_printf { printf @_ } sub do_sprintf { print sprintf @_ } do_printf(%s\n,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.