Ed,
That's what I thought I set it up that way to begin with but after reading the help file notes on functions I thought that I would need the parentheses, brackets and types. the text that hovers over the line as I entered the data showed all of that.
I changed the code to the following, now I am getting an error on the first line of the function that says: "Member exists in an object module from which this object module derives" I have checked everywhere and I cannot find where else any of this line is used.
Code:
Sub CreateSubset_Click()
Dim oSheetDb2 As AcSmDatabase, _
strName2 As String, _
strDesc2 As String, _
strNewSheetLocation2 As String, _
strNewSheetDWTLocation2 As String, _
strNewSheetDWTLayout2 As String, _
bPromptForDWT2 As Boolean
Dim strCurrentDwgName2 As String
Dim strShSetFileName2 As String
CreateSubset oSheetDb2, strName2, strDesc2, strNewSheetLocation2, strNewSheetDWTLocation2, strNewSheetDWTLayout2, bPromptForDWT2
End Sub
Private Function CreateSubset(oSheetDb As AcSmDatabase, _
strName As String, _
strDesc As String, _
Optional strNewSheetLocation As String = "", _
Optional strNewSheetDWTLocation As String = "", _
Optional strNewSheetDWTLayout As String = "", _
Optional bPromptForDWT As Boolean = False) As AcSmSubset
'' Create a Subset with the provided name and description
Set CreateSubset = oSheetDb.GetSheetSet().CreateSubset(strName, strDesc)
'' Get the Folder the Sheet Set is Stored in
Dim strSheetSetFldr As String
strSheetSetFldr = Mid(oSheetDb.GetFileName, 1, InStrRev(oSheetDb.GetFileName, "\"))
'' Create a reference to a File Reference object
Dim oFileRef As IAcSmFileReference
Set oFileRef = CreateSubset.GetNewSheetLocation
'' Check to see if a path was provided, if not default to the Sheet Set location
If strNewSheetLocation <> "" Then
oFileRef.SetFileName strNewSheetLocation
Else
oFileRef.SetFileName strSheetSetFldr
End If
'' Set the new sheet location for the Subset
CreateSubset.SetNewSheetLocation oFileRef
'' Create a reference to a Layout Reference object
Dim oLayoutRef As AcSmAcDbLayoutReference
Set oLayoutRef = CreateSubset.GetDefDwtLayout
'' Check to see that a default DWT Location was passed in
If strNewSheetDWTLocation <> "" Then
'' Set the location of the template in the Layout Reference object
oLayoutRef.SetFileName strNewSheetDWTLocation
'' Set the Layout name for the Layout Reference object
oLayoutRef.SetName strNewSheetDWTLayout
'' Set the Layout Reference to the Subset
CreateSubset.SetDefDwtLayout oLayoutRef
End If
'' Set the Prompt for Template option of the Subset when a new Sheet is created
CreateSubset.SetPromptForDwt bPromptForDWT
End Function