I haven't looked into the possibility to doing this through AutoCAD api but you could test using a Win32 API call.
This is one of the options posted in arcticad's reply. This just shows you which AutoCAD property to use. This is untested fyi.
Declare Auto Funtion SetForeGroundWindow Lib "User32.dll"(ByVal Hwnd As IntPtr) As Long 'Call these API's through your code SetForeGroundWindow(Autodesk.AutoCAD.ApplicationSe
Another option that works in AutoCAD 2014 :
I had to set this aside for a bit....I am only a part time programmer. Soooo, I had some time to try the last suggestion. I am working in VB not C# so I converted the code but get an error on the "Dynamic" type.
Dim acaddoc As Document = Autodesk.AutoCAD.ApplicationServices.Application.D
ocumentManager.MdiActiveDocument Dim ed As Editor = acaddoc.Editor Dim acadDocObj As Dynamic = acaddoc.GetAcadDocument()
My code does not like the Dynamic object???? I am running VS2010 with AutoCAD2014.
Any suggestions on what I'm doing wrong?
Well I tried something different and got an appropriate solution. I added the following before my MsgBox.
Excel now minimizes and then Autocad is the main visible application showing my message to the user.
Not sure why I didn't find this earlier but sometime a step away brings new ideas when you return.
thanks to everyone who provided responses.
myExcel.WindowState = Microsoft.Office.Interop.Excel.XlWindowState.xlMin
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register