Excel访问Domino VBA访问lotus domino

以前都是使用ls、java、sscs导出excel,现在能不能直接在Excel访问、操作Domino的数据呢?

当然可以了,可以使用VBA编写业务实现功能。VBA功能非常强大....。
 

Excel访问Domino VBA访问lotus domino_第1张图片

Sub getxml()
   Dim xml As String
   Dim url As String
   Dim i As Long
   Dim m As Long
    
   Dim objXML As Object
   Dim xmlFile As Object
   Dim root As Object
   Dim oXML As Variant
   Dim Queries As Object
   Dim Texts As Object
   Dim check As Boolean
   Dim startNum As Long
   Dim endNum As Long
   
   Set oXML = CreateObject("MSXml2.DOMDocument")
   
   check = True
   
   i = 1 '第几行
   
   startNum = 1
   endNum = 100
   
   While check
   
    url = "http://127.0.0.1/demo.nsf/V_post?ReadViewEntries&start=" + CStr(startNum) + "&Count=" + CStr(endNum) + "&id=" + CStr(Rnd * 100)
    xml = httpGET(url, "admin", "3624") '访问的地址和用户及密码信息
    'Debug.Print "xml-->" & xml
   
    oXML.LoadXML xml
    
    Set Queries = oXML.SelectNodes("//viewentry")
    
     If Queries.Length < 100 Then
        check = False
     Else
        startNum = endNum + 1
        endNum = endNum + 100
    End If
    
    'Debug.Print Queries.Length
    
    For Each Query In Queries
        Set Texts = Query.ChildNodes '获取子元素
        i = i + 1
        m = 0 '第几列
        For Each TextQuery In Texts
            m = m + 1
            If i = 2 Then
                ThisWorkbook.Sheets(1).Cells(i - 1, m) = TextQuery.getAttribute("name") '获取属性
            End If
            
            ThisWorkbook.Sheets(1).Cells(i, m) = TextQuery.Text '获取值
        Next
        
    Next
   
   Wend
    
End Sub

Excel访问Domino VBA访问lotus domino_第2张图片

 

你可能感兴趣的:(Eexcl,VBA,domino,VBA访问lotus,VBA访问domino,Excel访问lotus,Excel访问domino)