Excel splash screen animated dots on loading

mrwad

New Member
Joined
Oct 16, 2018
Messages
49
There are a lot of tutorials in the Internet. However I was not able to find anything suitable. Is there any way to make animated dots on loading?


The idea is to make a loop of animated dots
on userform so they would appear one after another and then would start over after some amount of dots.


So I input a dot to Label1 and move it to left after certain time criteria?

Something like https://media1.tenor.com/images/3aaadc45f4da67e52850a02aedf68040/tenor.gif?itemid=13427670


My current code for UserForm:


Code:
        Private Sub UserForm_Initialize()
    HideTitleBar.HideTitleBar Me
        Call loadingdots
    End Sub

Code for `Private Sub Workbook_Open()`:


Code:
    Loading.Show (vbModeless)
    
    Dim RngCom As Range
    Dim RngTurb As Range
    Dim RngGen As Range
    
    Application.Wait (Now + TimeValue("00:00:06"))
    
    ThisWorkbook.Worksheets("MAIN").ScrollArea = "$A$1:$BL$45"
        Application.DisplayFormulaBar = False
        ActiveWindow.DisplayHeadings = False
        ActiveWindow.DisplayGridlines = False
      etc...
      Unload Loading
    'Application.ScreenUpdating = True
      End Sub
 
Last edited:

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Here is the code that you would put in your UserForm. It is really a simple code sequence.

VBA Code:
Private Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As LongPtr) 'this is so that we can use the Sleep _

Private Sub UserForm_Activate()
HideBar Me
Label1.Caption = ChrW(9679)
Label2.Caption = ChrW(9679)
Label3.Caption = ChrW(9679)
dg = RGB(64, 64, 64)
wh = RGB(255, 255, 255)
'9679
t = 0

Do Until t = 4 ' will run for 6 seconds
    Label1.ForeColor = dg
    DoEvents
    Sleep 500
    Label1.ForeColor = wh
    Label2.ForeColor = dg
    DoEvents
    Sleep 500
    Label2.ForeColor = wh
    Label3.ForeColor = dg
    DoEvents
    Sleep 500
    Label3.ForeColor = wh
    t = t + 1
Loop
Unload Me
End Sub



The code that goes in This Workbook Module:

Code:
Private Sub Workbook_Open()
UserForm1.Show (False)
End Sub



A new module (I call mine "modCleanForm") that hides the titlebar on the form.

Code:
Option Explicit

#If VBA7 Then
    Public Declare PtrSafe Function FindWindow Lib "user32" _
                Alias "FindWindowA" _
               (ByVal lpClassName As String, _
                ByVal lpWindowName As String) As Long


    Public Declare PtrSafe Function GetWindowLong Lib "user32" _
                Alias "GetWindowLongA" _
               (ByVal hWnd As Long, _
                ByVal nIndex As Long) As Long


    Public Declare PtrSafe Function SetWindowLong Lib "user32" _
                Alias "SetWindowLongA" _
               (ByVal hWnd As Long, _
                ByVal nIndex As Long, _
                ByVal dwNewLong As Long) As Long


    Public Declare PtrSafe Function DrawMenuBar Lib "user32" _
               (ByVal hWnd As Long) As Long
#Else
    Public Declare Function FindWindow Lib "user32" _
                Alias "FindWindowA" _
               (ByVal lpClassName As String, _
                ByVal lpWindowName As String) As Long


    Public Declare Function GetWindowLong Lib "user32" _
                Alias "GetWindowLongA" _
               (ByVal hWnd As Long, _
                ByVal nIndex As Long) As Long


    Public Declare Function SetWindowLong Lib "user32" _
                Alias "SetWindowLongA" _
               (ByVal hWnd As Long, _
                ByVal nIndex As Long, _
                ByVal dwNewLong As Long) As Long


    Public Declare Function DrawMenuBar Lib "user32" _
               (ByVal hWnd As Long) As Long
#End If

Sub HideBar(frm As Object)

Dim Style As Long, Menu As Long, hWndForm As Long
hWndForm = FindWindow("ThunderDFrame", frm.Caption)
Style = GetWindowLong(hWndForm, &HFFF0)
Style = Style And Not &HC00000
SetWindowLong hWndForm, &HFFF0, Style
DrawMenuBar hWndForm

End Sub



Try it out. If you would like to see it in a finished workbook, you can see that here. I also have a preloader set with several different preloaders that you can check out here.
 
Upvote 0

Forum statistics

Threads
1,213,538
Messages
6,114,218
Members
448,554
Latest member
Gleisner2

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