CS端导入Excel

这段代码展示了如何使用VBA创建一个宏,该宏打开一个Excel文件,然后将数据从Excel工作表复制到Lotus Notes文档中。用户通过文件对话框选择Excel文件,然后程序会读取指定工作表上的数据,并将它们填入Notes文档的相应字段。最后,程序保存并关闭文档,Excel应用程序也会被关闭。
摘要由CSDN通过智能技术生成

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
        

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值