I have the following code in an Active X DLL: Dim i As Integer Dim ActiveDoc As AcadDocument Dim BlockedDWG As Variant Dim Mode As Variant Set ThisDrawing = AcadApplication.ActiveDocument For i = 1 To lvFiles.ListItems.Count Set ActiveDoc = ThisDrawing.Application.ActiveDocument BlockedDWG = lvFiles.ListItems.Item(i).Text MsgBox BlockedDWG Mode = ThisDrawing.GetVariable("sdi") MsgBox Mode If Mode = 1 Then ThisDrawing.Open BlockedDWG ElseIf Mode = 0 Then ThisDrawing.Application.Documents.Open BlockedDWG ThisDrawing.Application.ActiveDocument = ActiveDoc ThisDrawing.Close End If Next i The new drawing never gets set to active. The new drawing is opened and then drawing1.dwg is set active, but never gets closed. Any help would be appriciated Lenny