Error en macro de excel ¡
Twngo una macro diseñada en excel visual basic que simula el código de matrix, lo que sucede es que cambie la vesion del office a 365 y hay algunas funciones que no son compatibles con la version riginal con la que escribe el código por lo que esta macro ya no corre,
NO se como solucionarlo, ¿alguien me puede ayudar?
Anexo código pantalla donde indica el rojo el error
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub UserForm_Activate()
Application.OnTime Now + TimeValue("00:00:10"), "Quitform"
Dim cCntrl As control, u, x As Double
For x = 1 To 500
Set cCntrl = Me.Controls.Add("Forms.label.1", , True)
With cCntrl
.Font.Bold = True
.BorderStyle = fmBorderStyleNone
.SpecialEffect = fmSpecialEffectFlat
.ForeColor = &H9000&
.BackColor = vbBlack
.Width = 7
.Height = 100
.Top = Application.WorksheetFunction.RandBetween(0, Me.Height)
.Left = Application.WorksheetFunction.RandBetween(0, Me.Width)
End With
Next
Call nieve
End Sub
Sub nieve()
Dim cCntrl As control, u, x As Double, srt, letra As String
'srt = "abcdefghijklmnopqrstuvwxyz" '26
'srt = "12345678900987654321" '20
srt = "!#$%&/()=?¡¨*[]_:;¬\@!#$%&/?=)[]:;_" '35
'srt = "PROSA abdi2745!$#$¡?= PROSA ((/plndy&//)° PROSA !$%&%#[:;:/&*[]{ PROSA }0987mndj_:[]*¬#$ PROSA %&%$#lffog" '105
'srt = "PROSA !#$%&/() PROSA =?¡¨*[] PROSA _:;¬\@" '41
'srt = "abc1d!3e5#fgh5%i8j5/k0l)9m[7nopq*rst3;u5v7w8xyz" '47
'srt = "PROSA PROSA PROSA PROSA PROSA PROSA PROSA PROSA PROSA PROSA PROSA" '55
'srt = "PROSAabc1d!PROSA3e5#fghPROSA5%i8j5PROSA/k0l)9m[PROSA7nopq*rst3PROSA;u5v7w8xyzPROSA" '82
'srt = "PROSA abc1d! PROSA 3e5#fgh PROSA 5%i8j5 PROSA /k0l)9m[ PROSA 7nopq*rst3 PROSA ;u5v7w8xyz PROSA" '94
o:
For Each cCntrl In Me.Controls
Sleep 1 / 5
DoEvents
letra = Right(UCase(srt), Application.WorksheetFunction.RandBetween(1, 105))
cCntrl.Caption = letra
cCntrl.Top = cCntrl.Top + 10
On Error Resume Next
If cCntrl.Top > Me.Height Then cCntrl.Top = 0
Next
GoTo o
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
Cancel = CloseMode = vbFormControlMenu
End Sub