【发布时间】:2015-02-09 16:52:13
【问题描述】:
我正在调查将 Notes 数据库中的数据直接提取到 Excel 中,因为我们的财务人员正在手动重新键入数据 a.t.m. 到目前为止,这是我的代码:
子注释BB()
Const DATABASE = 1247
Dim r As Integer
Dim i As Integer
Dim c As Integer
Dim db As Object
Dim view As Object
Dim Entry As Object
Dim nav As Object
Dim Session As Object 'The notes session
Dim nam As Object
Dim val As Variant
Dim v As Double
Dim items As Object
Set Session = CreateObject("Lotus.NotesSession")
Call Session.Initialize
Set nam = Session.CreateName(Session.UserName)
user = nam.Common
Set db = Session.getdatabase("MSPreston", "Billbook1415.nsf")
Set view = db.GetView("By Month\By Dept")
view.AutoUpdate = False
Set nav = view.CreateViewNav
Set Entry = nav.GetFirst
val = Entry.childcount
val = Entry.ColumnValues(6) ' this doesn't work
Set items = Entry.ColumnValues 'from a suggestion on the net
val = items(6) 'this doesn't work either
MsgBox (val)
End Sub
错误是“对象变量或未设置块变量”
烦人的是,我可以在 ExcelVBA 调试窗口中看到我想要的值……所以我离得不远了。我猜它如何正确访问一组项目
【问题讨论】:
标签: excel lotus-notes vba