For several months macros has been working OK. Now nothing was changed in a code and it can't recognize label on the userform:
Private Sub UserForm_Initialize()
Path = Sheets("Settings").Cells(2, 1)
With PrintCh
.Top = center
.Height = 120
If Len(Path) * 10 <= 260 Then .Width = 265 Else .Width = Len(Path) * 7 + 5
End With
With Label1
.Caption = Path **'this string an ERROR: "Object variable or With block variable not set"**
.Width = Len(Path) * 7'**this string an ERROR: "Object variable or With block variable not set"**
End With
End Sub
Nothing helps - restarted, changed the label name, recreated new label, created new userform -nothing helps. What to do?