How do I add Please wait.... in the code

RAJESH1960

Banned for repeated rules violations
Joined
Mar 26, 2020
Messages
2,313
Office Version
  1. 2019
Platform
  1. Windows
Hello experts
My code takes more than 45 seconds to display the message box that the code has successfully completed. Is it possible to add some lines in the code like Please wait.... ? I am curious as well as excited to add that line in the code, as I have seen such messages before. This is to inform the user that the code is in motion and running so that he doesn't click any button till the message box is displayed. Once the code is run, the message Please wait.... should disappear and then display the message box that it is successfully completed.
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Hello Rajesh,

This is what I use to do with my time taking codes
Just insert a shape... format it the way you like & then set the visible property to True & the beggining of the code & set it to False at the end

VBA Code:
Sub rajesh()
ActiveSheet.Shapes.Range(Array("wiatmessage")).Visible = True

'Your code here

ActiveSheet.Shapes.Range(Array("wiatmessage")).Visible = False
End Sub


1662443774110.png
 
Upvote 0
Hello Rajesh,

This is what I use to do with my time taking codes
Just insert a shape... format it the way you like & then set the visible property to True & the beggining of the code & set it to False at the end

VBA Code:
Sub rajesh()
ActiveSheet.Shapes.Range(Array("wiatmessage")).Visible = True

'Your code here

ActiveSheet.Shapes.Range(Array("wiatmessage")).Visible = False
End Sub


View attachment 73293
Thanks hrayani. in office now. Will check tonight and revert back.
 
Upvote 0
hrayani. I am unable to insert the lines in the right place. Below the sub after defining the variables I inserted these lines
Rich (BB code):
ActiveSheet.Shapes.Range(Array("waitmessage")).Visible = True

waitmesaage = "Please Wait....."
and before end sub I inserted this line before the msg box.
Rich (BB code):
ActiveSheet.Shapes.Range(Array("waitmessage")).Visible = False
I am getting an error variable not defined. I defined the variable as long.
Are the lines inserted correctly as I am not able to view any message only buffering circle.
 
Upvote 0
I am not able to post the code here as there are more than 100000 characters. Sharing the link containing the code. I have commented out your lines of code you shared.
new 3.txt
 
Upvote 0
Just insert a shape... format it the way you like & then set the visible property to True & the beggining of the code & set it to False at the end
I did not understand this part. By the way, the code is in 4 different modules.
 
Upvote 0
Follow below points

1) See below screenshot & draw a shape in excel
2) Edit the shape & add text (what every you like - for example pls wait ect
2) then name the shape "waitmessage"
3) then put the below line at the very beggining of your code
VBA Code:
ActiveSheet.Shapes.Range(Array("wiatmessage")).Visible = True
4) the put the below line at the very end of your code
VBA Code:
ActiveSheet.Shapes.Range(Array("wiatmessage")).Visible = False


1662470284378.png
 
Upvote 0

Forum statistics

Threads
1,215,432
Messages
6,124,858
Members
449,194
Latest member
HellScout

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