Retrieve Message Box content in excel cells using vba

sanits591

Active Member
Joined
May 30, 2010
Messages
253
I would like to retrieve the content of the message box that appears on the screen into excel cells using VBA.

Request to help me with some suitable VBA code.
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
What does the message box state? Can you copy the code here so someone can take a look to help you find a solution.
 
Upvote 0
Let us say any of the message box appears on the screen using some code of VBA which is not accessible, and as soon as any of the Message comes on the screen during punching data in sheet, the following action should take place:


Make a list of all those messages with the time indicated in the column against each displayed message , alongwith the keystroke in separate column which was punched due to which the message appeared.

Col A Col B Col C
This is Red 09:47 am a1
This Red & Green 09:49 am ap
Excellent 09:53 am aqwe
...
& so on
 
Last edited:
Upvote 0
I don't think you can capture the message without knowing what is behind the code. If it is refers to cells then that can be done. But we would need to know the code behind the message box.

Why can't you access the code?
 
Upvote 0
I saw an excel game on friend's computer, where by punching the data or some keystokes, various messages come on the screen.

I thought of capturing the messages, and time taken by me to reach the destination and with the appropriate keystrokes.

I want to know this, because everytime the message appears differently, and it shall become very tedious to pen down the message and the keystrokes, so, i thought of taking the help of excel experts.
 
Upvote 0
If you just want to make a record of the message box, press Alt-PrtSc and paste into your worksheet.
 
Upvote 0
Thanks Ruddles! The suggested idea shall be manually and with this Alt +PrtSc the coveted requirement shall nt be fullfilled.

Reqeust to help on the desired objective.
 
Upvote 0
Sorry, I didn't understand that you wanted to capture it automatically.

In that case I'd go with Trevor's suggestion: modify the code to replace the MsgBox statements with some sort of code to divert the messages to your worksheet. That will be fairly simple once you can see the code.
 
Upvote 0
Thanks for responding to it.

The opportunity to see the code is not with us, as it was protected, and we need to work with the upcoming messages as and when they come in the worksheet, and capture it using some vba code.
 
Upvote 0
In that case I think you need to be focussing your efforts on finding a method of capturing the message box as a graphic image because I'm fairly sure the text is rendered before it's sent to the screen and is therefore not available as text.

However I stand to be corrected if anyone knows better.
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,752
Members
452,940
Latest member
rootytrip

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top