Message 1 of 7
Sheet Set API question..

Not applicable
09-27-2006
01:50 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've been trying to set a file path to the
"GetAltPageSetups.SetFileName" object in my sheet set file (it is for
the page setup overrides).
my problem is that if there is no path there to begin with my code fails
100% of the time giving me the error "SSM err: Object variable or With
block variable not set". I can't figure out what is wrong with it.
Anyone?
[code]
Sub Auto_DST_Paths(DSTPath As String)
Dim pathstart As String
Dim pathend As String
On Error GoTo whatsWrong
Set ssm = CreateObject("AcSmComponents.AcSmSheetSetMgr.17")
' open the database file
Set db = ssm.OpenDatabase(DSTPath, True)
' lock the database
Call db.LockDb(db)
' get the sheetset
Set ss = db.GetSheetSet
Dim TestinG As String
TestinG = "O:\Plotting\ACAD 2007 Setups\11x17 Metric.dwt"
ss.GetAltPageSetups.SetFileName (TestinG)
Dim oEnum As IAcSmEnumComponent
Set oEnum = ss.GetSheetEnumerator
Dim comp As IAcSmComponent
Set comp = oEnum.Next
Do While Not comp Is Nothing
If comp.GetTypeName = "AcSmSubset" Then
Dim subset As AcSmSubset
Set subset = comp
Call Sub_DST_Paths(subset)
End If
Set comp = oEnum.Next
Loop
' unlock the database
Call db.UnlockDb(db, True)
' close
Call ssm.Close(db)
exitHere:
Set ss = Nothing
Set ssm = Nothing
Set db = Nothing
Exit Sub
whatsWrong:
If Err Then
Debug.Print "SSM err: " & Err.Description
Err.Clear
End If
On Error GoTo 0
Call db.UnlockDb(db, True)
Resume exitHere
End Sub
[/code]
"GetAltPageSetups.SetFileName" object in my sheet set file (it is for
the page setup overrides).
my problem is that if there is no path there to begin with my code fails
100% of the time giving me the error "SSM err: Object variable or With
block variable not set". I can't figure out what is wrong with it.
Anyone?
[code]
Sub Auto_DST_Paths(DSTPath As String)
Dim pathstart As String
Dim pathend As String
On Error GoTo whatsWrong
Set ssm = CreateObject("AcSmComponents.AcSmSheetSetMgr.17")
' open the database file
Set db = ssm.OpenDatabase(DSTPath, True)
' lock the database
Call db.LockDb(db)
' get the sheetset
Set ss = db.GetSheetSet
Dim TestinG As String
TestinG = "O:\Plotting\ACAD 2007 Setups\11x17 Metric.dwt"
ss.GetAltPageSetups.SetFileName (TestinG)
Dim oEnum As IAcSmEnumComponent
Set oEnum = ss.GetSheetEnumerator
Dim comp As IAcSmComponent
Set comp = oEnum.Next
Do While Not comp Is Nothing
If comp.GetTypeName = "AcSmSubset" Then
Dim subset As AcSmSubset
Set subset = comp
Call Sub_DST_Paths(subset)
End If
Set comp = oEnum.Next
Loop
' unlock the database
Call db.UnlockDb(db, True)
' close
Call ssm.Close(db)
exitHere:
Set ss = Nothing
Set ssm = Nothing
Set db = Nothing
Exit Sub
whatsWrong:
If Err Then
Debug.Print "SSM err: " & Err.Description
Err.Clear
End If
On Error GoTo 0
Call db.UnlockDb(db, True)
Resume exitHere
End Sub
[/code]