vba pops up error 'Run-time error' 380 ': Unable to set property Value. Invalid property value. How to update it

Majlo7

New Member
Joined
Sep 12, 2020
Messages
20
Office Version
  1. 2019
Platform
  1. Windows
Appears when "CPListBox = WT9cp"
I am a beginner or anyone knows how to solve this

VBA Code:
Private Sub SpinButton2_SpinUp()


'            'lo razem
'            '--- Select---
ThisWorkbook.Worksheets("lo razem").Select
ActiveCell.Offset(-1).Select

             '--- Select---
Label3 = Format(ActiveWorkbook.Worksheets("lo razem").Cells(ActiveCell.Row, 3).value, "dd.mmm.yyyy")
Dim WT1czas  As String, WT2ustalony  As String, WT3zu  As String, WT4z_o As String, WT5urlopy  As String, WT6święto  As String, _
WT7lekarz As String, WT8zl  As String, WT9cp As String
WT1czas = ActiveWorkbook.Worksheets("lo razem").Cells(ActiveCell.Row, 5).value
WT2ustalony = ActiveWorkbook.Worksheets("lo razem").Cells(ActiveCell.Row, 6).value
WT3zu = ActiveWorkbook.Worksheets("lo razem").Cells(ActiveCell.Row, 7).value
WT4z_o = ActiveWorkbook.Worksheets("lo razem").Cells(ActiveCell.Row, 8).value
WT5urlopy = ActiveWorkbook.Worksheets("lo razem").Cells(ActiveCell.Row, 9).value
WT6święto = ActiveWorkbook.Worksheets("lo razem").Cells(ActiveCell.Row, 10).value
WT7lekarz = ActiveWorkbook.Worksheets("lo razem").Cells(ActiveCell.Row, 11).value
WT8zl = ActiveWorkbook.Worksheets("lo razem").Cells(ActiveCell.Row, 12).value
WT9cp = ActiveWorkbook.Worksheets("lo razem").Cells(ActiveCell.Row, 14).value
ListBox01 = WT1czas
ListBox02 = WT2ustalony
ListBox03 = WT3zu
ListBox04 = WT4z_o
ListBox05 = WT5urlopy
ListBox06 = WT6święto
ListBox07 = WT7lekarz
ListBox08 = WT8zl
CPListBox = WT9cp

ActiveWorkbook.Worksheets("lo g").Select
ActiveCell.Offset(-1).Select
If ThisWorkbook.Worksheets("lo g").Cells(ActiveCell.Row, 11).value = "" Then
txtPoleCzasPoczątkowy = "__:__"
ComboBox1 = "__:__"
Else
txtPoleCzasPoczątkowy = Format(ThisWorkbook.Worksheets("lo g").Cells(ActiveCell.Row, 11).value, "hh:nn")
End If
If ThisWorkbook.Worksheets("lo g").Cells(ActiveCell.Row, 12).value = "" Then
txtPoleCzasKońcowy = "__:__"
ComboBox2 = "__:__"
Else
txtPoleCzasKońcowy = Format(ThisWorkbook.Worksheets("lo g").Cells(ActiveCell.Row, 12).value, "hh:nn")
End If
If ThisWorkbook.Worksheets("lo g").Cells(ActiveCell.Row, 15).value = "" Then
txtPoleCzasDodatkowy2 = "__:__"
ComboBox3 = "__:__"
Else
txtPoleCzasDodatkowy2 = Format(ThisWorkbook.Worksheets("lo g").Cells(ActiveCell.Row, 15).value, "hh:nn")
End If
TextBox29 = ThisWorkbook.Worksheets("lo g").Cells(ActiveCell.Row, 4).value


End Sub
 
Last edited by a moderator:

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Try changing your declaration for the variable WT9cp
VBA Code:
WT9cp As Variant
 
Upvote 0
Upvote 0
managed to solve
the reason was that ListBox04.Selected (0) = True was not present
 
Upvote 0
Your post that you marked as the solution is not relevant to the error.

If you would like to explain the solution then it is perfectly fine to mark your post as the solution to help future readers. Otherwise, please do not mark a post that doesn't contain a solution.
 
Upvote 0

Forum statistics

Threads
1,214,982
Messages
6,122,580
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top