Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying Msgbox in another application

Status
Not open for further replies.

jrice174

Civil/Environmental
Nov 8, 2004
129
I'm writing a VBA program in AutoCAD. I open Excel and dump some data in the spreadsheet and then I want to display a msgbox that says "Data Extraction Completed". Since the spreadsheet is on top, I need to invoke the msgbox from the Excel application for it to be on top. Can I display a msgbox in Excel from AutoCAD?
 
Replies continue below

Recommended for you

I don't think you can do it directly but you could have a macro inside of Excel that would display the message box when a certain cell is populated. Then, have the last step of your data dump be to write a flag to that cell.

--------------------
How much do YOU owe?
--------------------
 
I don't know of a way, other than having the Excel sheet contain a macro and calling the macro using the .run method of the Excel Application object.


Would it suffice to re-activate AutoCad, display the message box, and then re-activate Excel?

Alternately, you could set the Excel application visibility to False while processing, and then set it to True and AppActivate it when processing is complete. Then the message box is not needed.
 
That was too easy. It worked fine and it gave me the exact results I wanted. THANKS
 
I opened the Excel spreadsheet and wrote the data to the spreadsheet. Then I used the command Excel.Visible = False to hide the spreadsheet so the AutoCAD application was visible to display the msgbox. After the msgbox statement I then had the Excel.Visible = True command to make the Excel application visible again. Just make sure that the last thing you do is make the spreadsheet visible or else when you go to open it again, you won't see anything.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor