Jan ... I found the issue but, not sure how to fix it. What I am doing after attaching the reference is running a sub function that will do a text substitution on the attached reference.
Then running a second vba that works off finding Reference with Logical name as "BORDER".
When I remove the sub function for text substitution everything works as expected and the second vba finds the reference with the Reference Logical name as "Border".
Below is the sub function for text substation after attaching the reference file:
Sub ChgTitleBlockYear() ' add to change titleblock year
Dim today As String
Dim MyDate As String
Dim Mystr As String
Dim find As String
Dim replace As String
find = "YYYY Delhaize America Shared Services LLC"
MyDate = Date
Mystr = Format(MyDate, "yyyy")
replace = Mystr & " Delhaize America Shared Services LLC"
CadInputQueue.SendCommand "Reference Activate Border"
CadInputQueue.SendCommand "xy=0,0,0"
'find and replace text
CadInputQueue.SendCommand "mdl load findreplacetext"
CadInputQueue.SendKeyin "FIND DIALOG ZOOM False"
CadInputQueue.SendKeyin "FIND DIALOG PAN False"
CadInputQueue.SendKeyin "FIND DIALOG SEARCHSTRING " & find
CadInputQueue.SendKeyin "FIND DIALOG REPLACESTRING " & replace
CadInputQueue.SendKeyin "change text all"
CadInputQueue.SendCommand "mdl unload findreplacetext"
CadInputQueue.SendCommand "Reference DeActivate Border"
CommandState.StartDefaultCommand
End Sub
Not sure why removing the ChgTitleBlockYear() call within the program solves my issue.
TIA,