最近需要建立数据库结构的pdm,文档都是word的表格。如果简单的复制粘贴,那工作量太大了。偷懒的人总会想办法。网上搜索了一下,可把word的表格,复制到excel中,然后通过excel再导入powerdesigner
1.新建test.xls,把表内容复制到test.xls结果如下
要在sheet1中
然后打开powerdesigner,菜单栏的工具–>Execute Command–> Edit/Run Script
然后把下面的脚步粘贴过去,修改脚本里的文件路径:D:\test.xls为自己的文件路径。
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 '