Forum Discussion
Excel for Web: Control equivalent to the VBA messagebox
I created a sheet with some shape to simulate a Msgbox.
I added manually and Excel assign some default names to these shapes
I created a simple macro that show the real name of the shape assigned form Excel and the text inside in each shapes.
In this way we can identify the index of every shapes and , activating the edit part of the macro, assign a useful name to every shapes.
I assigned titolo and messaggio to the shapes that will contain the text of the msgbox.
The buttons don't necessarily need a name because I assigned 3 specific macros to them.
I defined a function
- msgBoxTyp ( one of the possibile msgbox define in an enum, showed below)
This function Unhide the Msgbox worksheet and write in some defined cells (covered by the shape) where i write the parameter of the Msgbox.
The big problem is that isn't possible call one function from another macro, than i have to copy this function in every macro that need a MsgBox
Another big problem is that the execution of a macro from a button pressing is always very very slow.
A macro that need 1 second to run, have to wait :
- the initialization of the button (5 seconds more or less)
- the preparation of the button (5-10 seconds more or less)
- the execution of the macro