Why does my screen not update to show my shape after I create it?
Shape code
I am confused
Code:
Sub FillBase()
Dim TList As Integer, weekdaycol As Integer, weekday As Integer, reff As Integer, refs As Worksheet, ws As Worksheet, ClassesSet As Integer
reff = 5
Set refs = Sheets("Sheet1")
Set ws = Sheets("Sheet2")
ws.Select
ActiveWindow.ScrollRow = 1
[COLOR=#ff0000]Call Commands.Create_Shape[/COLOR]
[COLOR=#ff0000]DoEvents[/COLOR]
Application.ScreenUpdating = False
ws.Columns("A:AF").Hidden = False
Call ClearWeek
For weekday = 5 To 169 Step 41
TList = 3
weekdaycol = 2
While refs.Range("A" & TList) <> ""
ws.Cells(weekday - 1, weekdaycol) = refs.Range("A" & TList)
ws.Cells(weekday + 18, weekdaycol) = refs.Range("A" & TList)
ws.Cells(weekday - 2, weekdaycol) = refs.Range("B" & TList)
Call FillWeekday(TList, weekdaycol, refs, ws, reff, weekday - 5)
TList = TList + 1
weekdaycol = weekdaycol + 1
Wend
reff = reff + 2
Next weekday
If weekdaycol <= 31 Then
Range(Columns(weekdaycol), Columns(31)).Hidden = True
End If
Call FillInClass
Call EC.Input_All_Classes
Call Levels
Sheets("PB").Range("KZ1:LJ40").Replace "x", "", xlWhole
ws.Select
Call Lunches
Application.ScreenUpdating = True
[COLOR=#ff0000]Call Commands.Delete_Shape[/COLOR]
[COLOR=#ff0000]DoEvents[/COLOR]
If ws.Range("AJ1") = True Then
ClassesSet = MsgBox("Are there changes?", vbYesNo)
Else
ClassesSet = vbYes
ws.Range("AJ1").Value = True
End If
If ClassesSet = vbYes Then Call Group_Classes(ws)
[COLOR=#ff0000]Call Commands.Create_Shape[/COLOR]
[COLOR=#ff0000]DoEvents[/COLOR]
Application.ScreenUpdating = False
Call A_Prep_For_All
Application.ScreenUpdating = True
[COLOR=#ff0000]Call Commands.Delete_Shape[/COLOR]
[COLOR=#ff0000]DoEvents[/COLOR]
End Sub
Shape code
Code:
Sub Create_Shape()Dim MyShape As Object
Set MyShape = ActiveSheet.Shapes.AddShape(msoShapeRectangle, 10, 10, 800, 600)
With MyShape
.Name = "Wait"
With .Line
.ForeColor.RGB = RGB(255, 255, 0)
.Weight = 3
End With
With .Fill
.ForeColor.RGB = RGB(254, 255, 180)
.Transparency = 0
.Solid
End With
With .TextFrame
.Characters.Text = "Schedule is being created." & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & "Please be patient..."
.Characters(1, 30).Font.Color = RGB(0, 0, 0)
.Characters(30, 70).Font.Color = RGB(128, 128, 128)
.Characters.Font.Bold = True
.Characters(1, 70).Font.Size = 24
.Characters.Font.Name = "Helvetica"
.HorizontalAlignment = xlHAlignCenter
.VerticalAlignment = xlVAlignCenter
End With
End With
DoEvents
End Sub
I am confused
Last edited: