PowerDesigner导入Excel/CSV
来源:互联网 发布:幽灵行动4画面优化 编辑:程序博客网 时间:2024/06/05 21:04
转自:http://blog.csdn.net/hjay0715/article/details/49404939
在:Tool -> Execute Commands -> Edit/Run Script 中执行下面的脚本
Option Explicit Dim mdl ' the current model Set mdl = ActiveModel If (mdl Is Nothing) Then MsgBox "There is no Active Model" End If Dim HaveExcel Dim RQ RQ = vbYes 'MsgBox("Is Excel Installed on your machine ?", vbYesNo + vbInformation, "Confirmation") If RQ = vbYes Then HaveExcel = True ' Open & Create Excel Document Dim x1 ' Set x1 = CreateObject("Excel.Application") x1.Workbooks.Open "C:/Users/Chenth/Desktop/tmpdir/mytable.csv" x1.Workbooks(1).Worksheets("mytable").Activate Else HaveExcel = False End If a x1, mdl sub a(x1,mdl) dim rwIndex dim tableName dim colname dim table dim col dim count 'on error Resume Next For rwIndex = 1 To 120 step 1 With x1.Workbooks(1).Worksheets("mytable") 'MsgBox "生成数据表结构共计1 ="+CStr(.Cells(2,2).Value ), vbOK + vbInformation, "表" If .Cells(rwIndex, 1).Value = "" Then Exit For End If If .Cells(rwIndex, 3).Value = "" Then set table = mdl.Tables.CreateNew table.Name = .Cells(rwIndex , 1).Value table.Code = .Cells(rwIndex , 2).Value count = count + 1 Else colName = .Cells(rwIndex, 1).Value set col = table.Columns.CreateNew 'MsgBox .Cells(rwIndex, 1).Value, vbOK + vbInformation, "列" col.Name = .Cells(rwIndex, 1).Value 'MsgBox col.Name, vbOK + vbInformation, "列" col.Code = .Cells(rwIndex, 2).Value col.Comment = .Cells(rwIndex,1).Value col.DataType = .Cells(rwIndex, 3).Value End If End With Next MsgBox "生成数据表结构共计" + CStr(count), vbOK + vbInformation, "表" Exit Sub End sub
阅读全文
0 0
- PowerDesigner导入Excel/CSV
- excel/csv导入postgresql
- powerdesigner 从excel导入表
- OleDb导入csv和excel
- PowerDesigner使用脚本批量导入excel
- excel中的表定义导入到powerdesigner
- powerdesigner-从excel导入table模型。
- Excel批量导入表结构到PowerDesigner
- 从Excel导入Powerdesigner的方式
- 三、导入csv格式的excel
- Excel导入CSV文件中文乱码
- qt导入导出excel和csv
- MySQL导入csv、excel或者sql文件
- php excel导出 导入问题 csv格式
- python导入TXT、Excel、csv文件
- 500M的csv文件导入oracle-Excel分页导入
- java导出excel,导入excel,导出csv工具类整理
- CSV保存就会是EXCEL格式,CSV是逗号分隔符 将CSV导入DATATABLE, 将DATATABLE保持CSV
- 【笔记】机器学习里的各种LOSS(L1,L2)
- 逻辑运算符的用法
- Spark+Hadoop安装注意事项
- 图像特征描述子之BRIEF
- 反射
- PowerDesigner导入Excel/CSV
- 使用GreenDao遇到的问题
- 【2017年浙江中医药大学大学生程序设计竞赛(重现赛)】A B E F G
- 产品经理不再纸上谈兵——微信公众号PK原生App
- Hibernate与MyBatis的区别
- 把秒转换成日期
- 质数判断
- 数字和千位符(金额)格式的相互转换
- 数据结构与算法复习第二弹(冒泡排序)