ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Calling msgbox in Excel (https://www.excelbanter.com/excel-programming/378745-calling-msgbox-excel.html)

Ben

Calling msgbox in Excel
 
Hi all,

I just starting using VS2002. Currently in my Excel XP development, I can
use the msgbox to have it display a message.

While I was experimenting with VS 2002 and the PIA, I was wondering how I
can cause Excel to display a msgbox instead of one from the VS 2002 code.
Displaying a msgbox from within VS2002 causes the msgbox to appear behind
Excel. Whereas I would like to code it in such a way in VS2002 such that
when I instantiate an instance of Excel I would like Excel to display a
msgbox so that it is on top/ in front of Excel instead of behind it. Any
ideas? Thanks.

Ben



--


Tom Ogilvy

Calling msgbox in Excel
 
You would have to call a macro or otherwise execute a macro in Excel (written
in VBA) that displays the message box. (and perhaps returns a value).

--
Regards,
Tom Ogilvy


"Ben" wrote:

Hi all,

I just starting using VS2002. Currently in my Excel XP development, I can
use the msgbox to have it display a message.

While I was experimenting with VS 2002 and the PIA, I was wondering how I
can cause Excel to display a msgbox instead of one from the VS 2002 code.
Displaying a msgbox from within VS2002 causes the msgbox to appear behind
Excel. Whereas I would like to code it in such a way in VS2002 such that
when I instantiate an instance of Excel I would like Excel to display a
msgbox so that it is on top/ in front of Excel instead of behind it. Any
ideas? Thanks.

Ben



--


Tom Ogilvy

Calling msgbox in Excel
 
I haven't worked in .NET, but here is some added:

http://support.microsoft.com/kb/306682/en-us
How to run Office macros by using Automation from Visual Basic .NET

http://support.microsoft.com/kb/303871/en-us
How To Create an Excel Macro by Using Automation from Visual Basic .NET

--
Regards,
Tom Ogilvy



"Ben" wrote:

Hi all,

I just starting using VS2002. Currently in my Excel XP development, I can
use the msgbox to have it display a message.

While I was experimenting with VS 2002 and the PIA, I was wondering how I
can cause Excel to display a msgbox instead of one from the VS 2002 code.
Displaying a msgbox from within VS2002 causes the msgbox to appear behind
Excel. Whereas I would like to code it in such a way in VS2002 such that
when I instantiate an instance of Excel I would like Excel to display a
msgbox so that it is on top/ in front of Excel instead of behind it. Any
ideas? Thanks.

Ben



--


NickHK

Calling msgbox in Excel
 
Ben,
That MsgBox is not part of Excel, but VBA. Its full reference is :
VBA.Interaction.MsgBox

So unless you can access this from your environment, you are out of luck.
Excel does have an InputBox method, but that may not be want you want.

Otherwise maybe the MessageBox/MessageBoxEx API calls will do what you need.

NickHK

"Ben" wrote in message
...
Hi all,

I just starting using VS2002. Currently in my Excel XP development, I can
use the msgbox to have it display a message.

While I was experimenting with VS 2002 and the PIA, I was wondering how I
can cause Excel to display a msgbox instead of one from the VS 2002 code.
Displaying a msgbox from within VS2002 causes the msgbox to appear behind
Excel. Whereas I would like to code it in such a way in VS2002 such that
when I instantiate an instance of Excel I would like Excel to display a
msgbox so that it is on top/ in front of Excel instead of behind it. Any
ideas? Thanks.

Ben



--





All times are GMT +1. The time now is 02:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com