Hi, I am working on one macro that read drawing names from excel, opens it, do some modification. After that I would need to save and close active drawing. When I use expression acDoc.SaveAndClose(acDoc.Name) I am getting g an error - drawing is busy. I can save the drawing use save as method without any problems but can save and close it. Do you know what could be an issue? Probably I have to release that drawing or make it active somehow.
Methink you have to use P/Invoke [DllImport ("user32.dll")] static extern IntPtr SetFocus (IntPtr hWnd); // Then in the code after save as: SetFocus (Application.DocumentManager.MdiActiveDocument.Window Handle); Application.DocumentManager.MdiActiveDocument.CloseAndDiscard(); // not tested, just an idea