<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Accessing Sheetset Manager from VBA in Access in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/accessing-sheetset-manager-from-vba-in-access/m-p/13423710#M50</link>
    <description>&lt;P&gt;First, all you need to do is create a new instance of ssm with the &lt;FONT color="#0000FF"&gt;New&lt;/FONT&gt; keyword. You don't need the following line:&lt;/P&gt;
&lt;P&gt;Set objSSM = CreateObject("AcSmComponents.AcSmSheetSetMgr.24")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you read the inline comments in my code, you will see that I mentioned that you only use this version when creating an instance from outside the current thread, which as I spoke of elsewhere, doesn't work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Second, I showed you in my last post how to open a sheetset and enumerate the sheets.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create a new ssm&lt;/P&gt;
&lt;P&gt;Create a new db&lt;/P&gt;
&lt;P&gt;set the db = ssm.Opendatabase&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally, Jimmy Bergmark sells a &lt;A href="https://jtbworld.com/ssmpropeditor" target="_blank" rel="noopener"&gt;SheetSet property editor&lt;/A&gt;. It can access shetsets outside of AutoCAD. He also does custom programming. If you contact him, maybe he has a COM api that will work with VBA.&lt;/P&gt;</description>
    <pubDate>Sun, 13 Apr 2025 20:39:21 GMT</pubDate>
    <dc:creator>Ed__Jobe</dc:creator>
    <dc:date>2025-04-13T20:39:21Z</dc:date>
    <item>
      <title>Accessing Sheetset Manager from VBA in Access</title>
      <link>https://forums.autodesk.com/t5/vba-forum/accessing-sheetset-manager-from-vba-in-access/m-p/13409041#M43</link>
      <description>&lt;P&gt;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&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(Set objSheetSetManager = acadApp.GetInterfaceObject("AcSmSheetSetMgr.Application"))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dim acadApp As AcadApplication&lt;BR /&gt;Dim objSheetSetManager As Object&lt;BR /&gt;Dim objSheetSetDB As Object&lt;BR /&gt;Dim sheetsetname As String&lt;BR /&gt;&lt;BR /&gt;' Attempt to hook into an existing AutoCAD application&lt;BR /&gt;On Error Resume Next&lt;BR /&gt;Set acadApp = GetObject(, "AutoCAD.Application")&lt;BR /&gt;&lt;BR /&gt;' If AutoCAD is not running, start it&lt;BR /&gt;If acadApp Is Nothing Then&lt;BR /&gt;Set acadApp = CreateObject("AutoCAD.Application")&lt;BR /&gt;End If&lt;BR /&gt;On Error GoTo 0&lt;BR /&gt;&lt;BR /&gt;If acadApp Is Nothing Then&lt;BR /&gt;MsgBox "AutoCAD is not installed or failed to start!", vbCritical&lt;BR /&gt;Exit Sub&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;' Attempt to access the Sheet Set Manager interface&lt;BR /&gt;Set objSheetSetManager = acadApp.GetInterfaceObject("AcSmSheetSetMgr.Application")&lt;/P&gt;</description>
      <pubDate>Fri, 04 Apr 2025 13:47:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/accessing-sheetset-manager-from-vba-in-access/m-p/13409041#M43</guid>
      <dc:creator>SMMJRC90</dc:creator>
      <dc:date>2025-04-04T13:47:25Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Sheetset Manager from VBA in Access</title>
      <link>https://forums.autodesk.com/t5/vba-forum/accessing-sheetset-manager-from-vba-in-access/m-p/13409756#M44</link>
      <description>&lt;P&gt;First, I would recommend reading &lt;A href="https://forums.autodesk.com/t5/vba/sheetset-manager/m-p/8593099" target="_blank" rel="noopener"&gt;this thread&lt;/A&gt;. Second, any time you feel the need to use &lt;FONT color="#0000FF"&gt;On Error Resume Next&lt;/FONT&gt;, I highly suggest enclosing it is it's own sub/function. This is a good indicator that you have a separate task that should be separate. To set AcadApplication variable, use this function.&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="visual-basic"&gt;Public Function GetAcad(Optional ver As String) As AcadApplication
    ' support multiple acad versions.
    'Sample ver for AutoCAD 2023 ' ".24.2"
    On Error Resume Next
    Dim acApp As AcadApplication
    Dim clsid As String
    clsid = "AutoCAD.Application"
    If Not ver = "" Then
        clsid = clsid &amp;amp; ver
    End If
    Set acApp = GetObject(, clsid)
    If acApp Is Nothing Then
        Set acApp = CreateObject(clsid)
    End If
    Set GetAcad = acApp
End Function&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Apr 2025 21:43:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/accessing-sheetset-manager-from-vba-in-access/m-p/13409756#M44</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2025-04-04T21:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Sheetset Manager from VBA in Access</title>
      <link>https://forums.autodesk.com/t5/vba-forum/accessing-sheetset-manager-from-vba-in-access/m-p/13409835#M45</link>
      <description>&lt;P&gt;Ed,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I agree that getting the AutoCAD object should be a separate function, in fact I do have a function that does that, I included that portion because I wanted to break my code down into something small to post, I have not had issues getting acadApp to populate. My issue is getting the .getinterfaceobject method to return a sheetsetmanager object.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Steve&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Apr 2025 23:21:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/accessing-sheetset-manager-from-vba-in-access/m-p/13409835#M45</guid>
      <dc:creator>SMMJRC90</dc:creator>
      <dc:date>2025-04-04T23:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Sheetset Manager from VBA in Access</title>
      <link>https://forums.autodesk.com/t5/vba-forum/accessing-sheetset-manager-from-vba-in-access/m-p/13409925#M46</link>
      <description>&lt;P&gt;I don't have time right now to try an idea I have, but in the meantime, see &lt;A href="https://forums.autodesk.com/t5/net/referencing-acsmcomponents-dll-error/m-p/11846171#12853818" target="_blank" rel="noopener"&gt;this post&lt;/A&gt; and read the rest of the thread. You need to understand how SSM works. You don't use getInterface. You create a New instance of the class and then open a database (i.e. dst). The problem is trying to do it outside of AutoCAD. &lt;A href="https://www.theswamp.org/index.php?topic=46497.0" target="_blank" rel="noopener"&gt;This thread&lt;/A&gt; at theSwamp deals with creating an app that bypasses the SSM and reads the dst directly.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Apr 2025 01:51:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/accessing-sheetset-manager-from-vba-in-access/m-p/13409925#M46</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2025-04-05T01:51:19Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Sheetset Manager from VBA in Access</title>
      <link>https://forums.autodesk.com/t5/vba-forum/accessing-sheetset-manager-from-vba-in-access/m-p/13410378#M47</link>
      <description>&lt;P&gt;The Prog ID used in GetInterfaceObject() method, should be "AcSmComponents.AcSmSheetSetMgr.2x" (2x depending on AutoCAD version, not "&lt;SPAN&gt;AcSmSheetSetMgr.Application", I believe.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Apr 2025 13:01:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/accessing-sheetset-manager-from-vba-in-access/m-p/13410378#M47</guid>
      <dc:creator>Norman_Yuan</dc:creator>
      <dc:date>2025-04-05T13:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Sheetset Manager from VBA in Access</title>
      <link>https://forums.autodesk.com/t5/vba-forum/accessing-sheetset-manager-from-vba-in-access/m-p/13410783#M48</link>
      <description>&lt;P&gt;I tried a test in xl but was unable to create an ssm object outside of AutoCAD. You might have more success using .NET. i was working on a class that wraps the ssm and simplifies some tasks. It's based on an early project by&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1706559"&gt;@ambrosl&lt;/a&gt;&amp;nbsp;that was presented at AU many years ago. I believe such a class could expose a ssm object. But perhaps the better route would be to use the method I linked to at theSwamp and access the dst directly instead of going through acad.&lt;/P&gt;
&lt;LI-CODE lang="visual-basic"&gt;Public Sub Test()
    On Error GoTo Err_Control
    
    Dim acad As AcadApplication
    Set acad = AcadApplication  'Use in AutoCAD)
    Set acad = GetAcad()        'Use outside AutoCAD

    Dim ssm As New AcSmSheetSetMgr  'Use in AutoCAD
    'Dim ssm As AcSmSheetSetMgr  'Use outside AutoCAD
    'Use in outside AutoCAD
    'Tried to create ssm in acad context but it didn't work
'    Set ssm = acad.GetInterfaceObject("AcSmComponents.AcSmSheetSetMgr.25")
    Dim db As New AcSmDatabase
    
    Dim str1 As String
    str1 = "C:\users\???\Downloads\test1.dst"
    Set db = ssm.OpenDatabase(str1)
    
    Dim dbEnum As IAcSmEnumPersist
    Set dbEnum = db.GetEnumerator
    Dim item As IAcSmPersist
    Set item = dbEnum.Next
'    Dim shEnum As IAcSmEnumComponent
'    Dim csPr As AcSmSheetSet
'    Dim shValue As IAcSmComponent
'    Dim objs() As Object
'    Dim retObjs As Object
'
'
'
'    'On Error Resume Next
'    While Not item Is Nothing
'        If item.GetTypeName = "AcSmSheetSet" Then
'        Set csPr = item
'        Set shEnum = csPr.GetSheetEnumerator
'        Set shValue = shEnum.Next
'        While Not shValue Is Nothing
'            'On Error Resume Next
'            Set retObjs = shValue.GetDirectlyOwnedObjects(objs)
'            Set shValue = shEnum.Next
'        Wend
'        End If
'    Set item = dbEnum.Next
'    Wend


Exit_Here:
   Exit Sub
Err_Control:
   Select Case Err.Number
      'Add your Case selections here
   'Case Is = 1000
      'Handle error
      'Err.Clear
      'Resume Exit_Here
   Case Else
      MsgBox Err.Number &amp;amp; ", " &amp;amp; Err.Description, , "Test"
      Err.Clear
      Resume Exit_Here
   End Select
End Sub
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Apr 2025 20:32:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/accessing-sheetset-manager-from-vba-in-access/m-p/13410783#M48</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2025-04-13T20:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Sheetset Manager from VBA in Access</title>
      <link>https://forums.autodesk.com/t5/vba-forum/accessing-sheetset-manager-from-vba-in-access/m-p/13421837#M49</link>
      <description>&lt;P&gt;I tried several combinations that I found online (AcSmComponents.AcSMSheetSetMgr.2x, ect...) none of them worked. I have decided to call this code directly in the AutoCAD environment to eliminate this hurdle. I am able to get some basic interaction with the SSM but have been getting a run time error&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"Automation error, the owner of the PerUser subscription is not logged on to the system specified"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have checked an I am logged into the system as me. and the "fully qualified file path" is a network location and is not user dependent. The error occurs when I try to call .SetName. If I comment that line out, it runs fine. I know that I do not have error handling implemented. this is very early development and I am just trying to prove that I can get this to work before building it out completely with perfect coding practices.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is the code that I am running within AutoCAD VBA&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="visual-basic"&gt;Sub OpenSheetSet()
   Dim objSSM As AcSmSheetSetMgr
   Dim objDB As AcSmDatabase
   Dim objSheetSet As AcSmSheetSet
   Dim objSheet As AcSmSheet

   Set objSSM = New AcSmSheetSetMgr
   Set objSSM = CreateObject("AcSmComponents.AcSmSheetSetMgr.24")
   Debug.Print "attempting to open"
   Set objDB = objSSM.OpenDatabase("fully qualified file path", True)
   Set objSheetSet = objDB.GetSheetSet
   Debug.Print "sheet set name: " &amp;amp; objSheetSet.GetName
   objSheetSet.SetName "Changed the Name"
   Debug.Print "sheet set name: " &amp;amp; objSheetSet.GetName

End Sub&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Moderator Edit: Put code in code window.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Apr 2025 20:21:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/accessing-sheetset-manager-from-vba-in-access/m-p/13421837#M49</guid>
      <dc:creator>SMMJRC90</dc:creator>
      <dc:date>2025-04-13T20:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Sheetset Manager from VBA in Access</title>
      <link>https://forums.autodesk.com/t5/vba-forum/accessing-sheetset-manager-from-vba-in-access/m-p/13423710#M50</link>
      <description>&lt;P&gt;First, all you need to do is create a new instance of ssm with the &lt;FONT color="#0000FF"&gt;New&lt;/FONT&gt; keyword. You don't need the following line:&lt;/P&gt;
&lt;P&gt;Set objSSM = CreateObject("AcSmComponents.AcSmSheetSetMgr.24")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you read the inline comments in my code, you will see that I mentioned that you only use this version when creating an instance from outside the current thread, which as I spoke of elsewhere, doesn't work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Second, I showed you in my last post how to open a sheetset and enumerate the sheets.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create a new ssm&lt;/P&gt;
&lt;P&gt;Create a new db&lt;/P&gt;
&lt;P&gt;set the db = ssm.Opendatabase&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally, Jimmy Bergmark sells a &lt;A href="https://jtbworld.com/ssmpropeditor" target="_blank" rel="noopener"&gt;SheetSet property editor&lt;/A&gt;. It can access shetsets outside of AutoCAD. He also does custom programming. If you contact him, maybe he has a COM api that will work with VBA.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Apr 2025 20:39:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/accessing-sheetset-manager-from-vba-in-access/m-p/13423710#M50</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2025-04-13T20:39:21Z</dc:date>
    </item>
  </channel>
</rss>

