Hi all,
I have a macro in excel that populates dwg blocks using informations from the spreadsheet.
Since sometimes I have to process a long list of dwgs at once, I would like to be able to use another application while the macro runs, but everytime the macro opens a new document with
Code:
Set acadDocCurr = acadApp.Documents.Open(filenameToOpen)
I lose focus of the current window.
Here's the declaration:
Code:
Dim acadDocCurr As AcadDocument
Dim acadApp As AutoCAD.AcadApplication
Set acadApp = CreateObject("AutoCAD.Application")
On the excel side I disable the screen updating, the events and set the calculation to manual:
Code:
Application.ScreenUpdating = False
Application.EnableEvents = False
prevCalculationState = Application.Calculation
Application.Calculation = xlManual
and I also hide my acad application object with
Code:
acadApp.Visible = False
But it doesn't help.
I tested by commenting out all the code except the open method, so I'm 100% that the problem is that instruction.
How can I prevent this behaviour?
I tried to search in the forum and on the entire Internet but I could not find anything about this case.
I'm on windows 7, autocad 2010, excel 2013.
Thanks for the attention!