Creating a pop-up text box in Excel 2000?

NeverLift

New Member
Joined
May 27, 2010
Messages
13
I've searched around (for hours!), the next is the best I've been able to come up with. It fails with Runtime error 1004 "Application-defined or object-defined error" at the Set WaitBox statement. Is this not available in Excel 2000?

The purpose is to create a "wait" message at the start of a long running process. WaitSheetName and WaitBoxName are public, defined in my module of all Public variables, to be used by the second sub, called when the process has ended, to destroy the message.

[The final will be a bit more elegant with the box parameters set to center it in the window, round the corners, etc.]

Code:
Sub PleaseWait(Optional TopMessage As Variant)
    Dim WaitMessage As String, WaitSheet As Worksheet, WaitBox As Shape
    WaitMessage = ""
    If Not IsMissing(TopMessage) Then WaitMessage = TopMessage & vbCrLf
    WaitMessage = WaitMessage & "Please wait . . ."
    Set WaitSheet = ActiveSheet
    WaitSheetName = ActiveSheet.Name
    Set WaitBox = WaitSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, _
        215, 195, 90, 60)
    WaitBox.TextFrame.Characters.Text = WaitMessage
    WaitBoxName = WaitBox.Name
End Sub

Sub EndWait()
    If WaitBoxName <> "" Then
        Sheets(WaitSheetName).TextBoxes(WaitBoxName).Delete
        WaitBoxName = ""
    End If
End Sub
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Forum statistics

Threads
1,214,979
Messages
6,122,557
Members
449,088
Latest member
davidcom

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