共享一段Excel导入Notes的代码
来源:互联网 发布:什么是网络中介 编辑:程序博客网 时间:2024/05/22 00:55
Sub Click(Source As Button)
'-------------------------------------------------------------
'-- PeiQingbin Excle导入--2
'-------------------------------------------------------------
Dim ws As New NotesUIWorkspace 'workspace
Dim ss As New NotesSession 'session
Dim db As NotesDatabase 'database
Dim item As NotesItem 'notes item
Dim files As Variant 'file name
Dim schar As String 'cell content
Dim doc As NotesDocument 'notes document
Dim dc As NotesDocumentCollection 'notes documents collection
Dim excelapplication 'Excel
Dim i,j As Integer 'number counter
Dim rowcount As Integer 'rows that need operate
Set db = ss.currentdatabase
Set dc=db.UnprocessedDocuments
rowcount=dc.Count
Messagebox("您选中了" + Cstr(rowcount) + "条记录,请您准备好文件,本次操作仅导入文件中的前" + Cstr(rowcount) + "条记录。" + Chr(13)+Chr(10)+"如果文件内数据行数不足,将以空值或0添入数据库。")
files = ws.openfiledialog(False,"请选择要导入的Excel文件","Excel file/*.xls")
If Not(Isempty(files)) Then
Set excelapplication = createobject("excel.application")
Set excelworkbook = excelapplication.workbooks.open(files)
If excelworkbook Is Nothing Then
excelapplication.quit
Exit Sub
End If
Set excelsheet = excelworkbook.worksheets(1)
i = 2 '从第二行开始读取
Set doc=dc.GetFirstDocument
While Not (doc Is Nothing)
doc.sjfypc = excelsheet.cells(i,1).value '实际发运批次
doc.fyzt = excelsheet.cells(i,2).value '发运状态
doc.jtfysj = excelsheet.cells(i,3).value '具体发运时间
doc.fy_loadmark="Excel 导入 at " + Cstr(Now())
Call doc.save(False,False) '保存
i=i+1
Set doc=dc.GetNextDocument(doc)
Wend
excelworkbook.close(False)
excelapplication.quit
Set excelapplication = Nothing
End If
End Sub
'-------------------------------------------------------------
'-- PeiQingbin Excle导入--2
'-------------------------------------------------------------
Dim ws As New NotesUIWorkspace 'workspace
Dim ss As New NotesSession 'session
Dim db As NotesDatabase 'database
Dim item As NotesItem 'notes item
Dim files As Variant 'file name
Dim schar As String 'cell content
Dim doc As NotesDocument 'notes document
Dim dc As NotesDocumentCollection 'notes documents collection
Dim excelapplication 'Excel
Dim i,j As Integer 'number counter
Dim rowcount As Integer 'rows that need operate
Set db = ss.currentdatabase
Set dc=db.UnprocessedDocuments
rowcount=dc.Count
Messagebox("您选中了" + Cstr(rowcount) + "条记录,请您准备好文件,本次操作仅导入文件中的前" + Cstr(rowcount) + "条记录。" + Chr(13)+Chr(10)+"如果文件内数据行数不足,将以空值或0添入数据库。")
files = ws.openfiledialog(False,"请选择要导入的Excel文件","Excel file/*.xls")
If Not(Isempty(files)) Then
Set excelapplication = createobject("excel.application")
Set excelworkbook = excelapplication.workbooks.open(files)
If excelworkbook Is Nothing Then
excelapplication.quit
Exit Sub
End If
Set excelsheet = excelworkbook.worksheets(1)
i = 2 '从第二行开始读取
Set doc=dc.GetFirstDocument
While Not (doc Is Nothing)
doc.sjfypc = excelsheet.cells(i,1).value '实际发运批次
doc.fyzt = excelsheet.cells(i,2).value '发运状态
doc.jtfysj = excelsheet.cells(i,3).value '具体发运时间
doc.fy_loadmark="Excel 导入 at " + Cstr(Now())
Call doc.save(False,False) '保存
i=i+1
Set doc=dc.GetNextDocument(doc)
Wend
excelworkbook.close(False)
excelapplication.quit
Set excelapplication = Nothing
End If
End Sub
- 共享一段Excel导入Notes的代码
- 一段通过OLE将Notes View中的内容导入Excel的示范代码
- 导入Excel到Notes的通用ScriptLibrary
- Notes导入excel表格
- Excel导入到notes中
- Excel导入到notes中
- 共享一段JS幻灯片代码
- 一段有关内核、用户空间共享内存的代码
- 我的一段 delphi 控制 Excel 的代码
- 一段利用Apache的Poi合并Excel单元格的代码
- 一段自己录制的Excel宏代码(画柏拉图)
- 这是一段silverlight导出Excel的代码 来自zhangfengyi
- VC操作Excel的概述和一段代码
- NET与EXCEL的有效导入代码
- C#导出导入到Excel的代码
- PHP实现导入excel表格的代码
- excel导入sql代码
- Excel导出导入代码
- Lex和yacc工具介绍
- 如何选择抽象基类与接口
- 智库专家称公平收入分配应成为宏观调控核心
- 浅拷贝和深拷贝
- 长大需要里程碑
- 共享一段Excel导入Notes的代码
- 基于RedHat Linux 下LVS(Ftp/CIFS)
- what is wtp
- 从C开始
- IDES学习--配额协议
- 谁掌握控制权,谁赢得胜利:巨网,baidu,代理,竞价排名,戴森
- 一段通过OLE将Notes View中的内容导入Excel的示范代码
- 接上文,以下部分是lvs实施部分:LVS+mon安装配置
- Happy Valley:妈呀(Maya)狂欢