MsgBox " Select Any of the two Options "
MyNote = "Which type of file ?"
Answer = MsgBox(MyNote, vbQuestion + vbYesNo, "")
If Answer = vbNo Then
Call A()
Else
Call B()
everything works properly ,but I just want to change the look of yes/no options to A and B so that the user better understands which option to choose for which file .
As commented you can use API as discusse HERE.
I posted the code below just in case the link is off and also incorporated your code. HTH.
If however you are using 64 Bit, you need to add PtrSafe.
One alternative you can use is an an input box. Al though this didn't give you "buttons" it does allow you a greater degree of freedom in accepting user input. The
Case
statements can easily be modified to include variations, misspellings, etc.I know it's about 2 years too late but I just want to help find the reason why it doesn't work for other people who would like to check out that Hook code. I wanted to comment but I can't comment because I need 50 reputations. Therefore, I am posting this as an answer and may be the mods can do whatever they want of this post... Anyway, @kevinarpe, the reason it didn't work is, you must have been running the test from Immediate window in VBE...I faced the same problem and it took me half a day to figure it out that I need to insert a button in Excel worksheet and assign the test macro to that button to make all this work. I think the reason it fails to work when run from Immediate window is because the SetDlgItemText somehow cannot find the hWnd of the msgbox. It's just my opinion, may be I'm wrong...if so, experts please correct... In any case, the Hook code really works! on my Win8.1, 32bit-Excel2010. A better code which can be run from within VBE can be found at: How do I change the names of buttons on a message box?