I have a macro that has been working fine for the last couple years, but now is throwing a run-time error and I am hoping someone may be able to point me the right direction to fix it.
While the actual macro does a number of things, I have been able to pinpoint the line causing the error (the Set line below) and have made a verify simplified macro that produces the error:
Sub Test() Dim NewRefAttachment As Attachment Set NewRefAttachment = ActiveModelReference.Attachments.Add("FILENAME", "Default", "Logical Name", "Description", Point3dFromXY(0, 0), Point3dFromXY(0, 0), True, True) NewRefAttachment.Rewrite End Sub
In the code above, if FILENAME is a DGN file, the attachment is added to the file just as you would expect. If FILENAME is a DWG file, I get a run-time error [Run-time error '-2147218317 (80040c73)': Cache not found]. While usually I have been attaching DGN files as references, I know I have successfully attached DWG files.
Any suggestions would be appreciated.