Doesn't recognize Label on the Userform

Viewed 21

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?

1 Answers

After the investigation was noticed problem wasn't shown on the other computers, so was solved after reinstall of MS Office. Maybe, some libraries got unavailable for some reason. Many thanks to Billy Gates for the lost half of the day. And thanks @ FaneDuru for the advice - the note about usimg Me.Lab was new for me.

Related