Dear All,
When I debug my code and try o restart a Userform I get this message...
runtime error 91 object variable or with block variable not set
I close and save, reopen the file and everything works fine until I have to debug again for any reason. So I have to keep saving, closing and restarting.
I've run a search in the project and I used "with" only in two ways in my code, here they are:
===============================
=================================
and ...
=================================
==========================
Any tip to solve the issue?
Thank you,
miami2k
When I debug my code and try o restart a Userform I get this message...
runtime error 91 object variable or with block variable not set
I close and save, reopen the file and everything works fine until I have to debug again for any reason. So I have to keep saving, closing and restarting.
I've run a search in the project and I used "with" only in two ways in my code, here they are:
===============================
VBA Code:
Sub PopolaCompl()
Dim rng As Range
Dim Cel1 As Range
Dim LR As Long
Dim ws As Worksheet
Set ws = Sheets("Filed")
With ws
LR = .Cells(.Rows.Count, "B").End(xlUp).Row
Scadenziario.ListBox2.Clear
If LR = 1 Then GoTo Finished Else
Set rng = .Range("A1:A" & LR).SpecialCells(xlCellTypeVisible)
With Scadenziario.ListBox2
.ColumnCount = 9
.ColumnWidths = "0;180;120;60;60;60;60;270;60;"
For Each Cel1 In rng
.AddItem CStr(Cel1.Value)
.List(.ListCount - 1, 0) = Cel1.Offset(0, 0).Value
.List(.ListCount - 1, 1) = Cel1.Offset(0, 1).Value
.List(.ListCount - 1, 2) = Cel1.Offset(0, 2).Value
.List(.ListCount - 1, 3) = Cel1.Offset(0, 3).Value
.List(.ListCount - 1, 4) = Cel1.Offset(0, 4).Value
.List(.ListCount - 1, 5) = Cel1.Offset(0, 5).Value
.List(.ListCount - 1, 6) = Cel1.Offset(0, 6).Value
.List(.ListCount - 1, 7) = Cel1.Offset(0, 7).Value
.List(.ListCount - 1, 8) = Cel1.Offset(0, 8).Value
Next Cel1
End With
End With
Finished:
End Sub
=================================
and ...
=================================
VBA Code:
Private Sub CommandButton10_Click()
With Scadenziario
.ComboBox13.ListIndex = 0
End With
End Sub
==========================
Any tip to solve the issue?
Thank you,
miami2k