Sub Click(Source As Button)
On Error Goto e
Dim ws As New NotesUIWorkspace 'workspace
Dim ss As New NotesSession 'session
Dim db As NotesDatabase 'database
Dim files As Variant,wjj As String,filename As String 'file name
Dim schar As String 'cell content
Dim tdoc As NotesDocument 'notes document
Dim excelapplication
Dim i,sheet
Set db = ss.currentdatabase
files = ws.openfiledialog(True,"请选择要导入的Word文件相应的Excel文件","Excel file/*.xls","e:\")
sheeet = 1
If Not(Isempty(files)) Then
answer% = Messagebox("你确定要导入所选中的文件?",4,"确定?")
If answer%<>6 Then
Exit Sub
End If
CS端导入Excel
这段代码展示了如何使用VBA创建一个宏,该宏打开一个Excel文件,然后将数据从Excel工作表复制到Lotus Notes文档中。用户通过文件对话框选择Excel文件,然后程序会读取指定工作表上的数据,并将它们填入Notes文档的相应字段。最后,程序保存并关闭文档,Excel应用程序也会被关闭。
摘要由CSDN通过智能技术生成