SolidWorks專門論壇 SolidWorks forum

 找回密碼
 註冊
查看: 25763|回復: 4

错误-2147417848(80010108)自动化(automation)错误

[複製鏈接]
發表於 2016/7/29 22:16:07 | 顯示全部樓層 |閱讀模式
Dim ObjClassFac As SwDMClassFactory
Dim swDM As SwDMApplication
Dim swDoc As SwDMDocument12
Dim swCfgMgr As SwDMConfigurationMgr
Dim mopenErrors As SwDmDocumentOpenError
Dim swcfg As SwDMConfiguration
Dim custpropertynames As Variant
Dim custpropertyname
Dim swdoctype As Integer
Dim a As Boolean
Const swDMlicensekey = "swdm许可序列号"
Sub getproperties()
Set ObjClassFac = CreateObject("SwDocumentMgr.SwDMclassfactory")
Set swDM = ObjClassFac.GetApplication(swDMlicensekey)
row = 3
f = Sheet1.Cells(row, 1)
200
If f <> "" Then
   If UCase(Right(f, 6)) = "SLDPRT" Then
   swdoctype = 1
   Else
   swdoctype = 2
   End If
   Set swDoc = swDM.GetDocument(f, swdoctype, False, mopenErrors)
   Set swCfgMgr = swDoc.ConfigurationManager
   Set swcfg = swCfgMgr.GetConfigurationByName("默认")
     'swcfg.DeleteCustomProperty "图号"
     'a = swcfg.AddCustomProperty("图号", 30, Sheet1.Cells(Row, 3))
     'Debug.Print Sheet1.Cells(Row, 3)
     'Debug.Print a
     Sheet1.Cells(row, 4) = swcfg.GetCustomProperty("车型", swDmCustomInfoText)
     Sheet1.Cells(row, 5) = swcfg.GetCustomProperty("图号", swDmCustomInfoText)
     Sheet1.Cells(row, 7) = swcfg.GetCustomProperty("版本号", swDmCustomInfoText)
     Sheet1.Cells(row, 8) = swcfg.GetCustomProperty("材料", swDmCustomInfoText)
     Sheet1.Cells(row, 9) = swcfg.GetCustomProperty("下料尺寸", swDmCustomInfoText)
     Sheet1.Cells(row, 10) = swcfg.GetCustomProperty("加工工艺", swDmCustomInfoText)
     Sheet1.Cells(row, 11) = swcfg.GetCustomProperty("备注", swDmCustomInfoText)
     swDoc.CloseDoc
     'Sheet1.Cells(row, 12) = "已处理"
     row = row + 1
     Debug.Print row
     f = Sheet1.Cells(row, 1)
     GoTo 200
End If
End Sub
 樓主| 發表於 2016/7/29 22:19:29 | 顯示全部樓層

                               
登錄/註冊後可看大圖

點評

运行到这里出错了。。。。  發表於 2016/7/29 22:19
 樓主| 發表於 2016/7/29 22:20:23 | 顯示全部樓層

                               
登錄/註冊後可看大圖
 樓主| 發表於 2016/7/29 22:21:01 | 顯示全部樓層
求大神指點
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

手機版上論壇|論壇來自幾何科技 論壇架構版次 20240312

GMT+8, 2024/4/26 22:39 , Processed in 0.115367 second(s), 16 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回復 返回頂部 返回列表