Accessing Sheetset Manager from VBA in Access
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a VBA project in MS Access and I would like to access the AutoCAD SSM from that project. When running the code below, I get an error saying "trouble loading application" at the line where I try to set the objSheetSetManager using acadApp.GetInterfaceObject Method
(Set objSheetSetManager = acadApp.GetInterfaceObject("AcSmSheetSetMgr.Application"))
I am able to gain access to the SSM if I run code from within the AutoCAD VBA IDE so I know AcSMComponents is installed. Does anyone have any experience accessing the SSM from outside of AutoCAD?
Dim acadApp As AcadApplication
Dim objSheetSetManager As Object
Dim objSheetSetDB As Object
Dim sheetsetname As String
' Attempt to hook into an existing AutoCAD application
On Error Resume Next
Set acadApp = GetObject(, "AutoCAD.Application")
' If AutoCAD is not running, start it
If acadApp Is Nothing Then
Set acadApp = CreateObject("AutoCAD.Application")
End If
On Error GoTo 0
If acadApp Is Nothing Then
MsgBox "AutoCAD is not installed or failed to start!", vbCritical
Exit Sub
End If
' Attempt to access the Sheet Set Manager interface
Set objSheetSetManager = acadApp.GetInterfaceObject("AcSmSheetSetMgr.Application")