Permission Denied Error

AlexanderBB

Well-known Member
Joined
Jul 1, 2009
Messages
2,099
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
Guessing a bit with this, but get the above error
VBA Code:
Private Sub listY_Click()
    listY.Enabled = True
    listY.List = Worksheets("Sheet1").Range("C20:C40").Value
End Sub
Am I on the right track, or not possible and I must use AddItem?
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Do you have a rowsource set? If so, you need to clear that first.
 
Upvote 0
Hi Rory thanks for the reply, but I'm still struggling.
No rowsource was set in Properties and instruction listY.RowSource = "" kept the same permission error.
Then i tried listY.RowSource = Worksheets("Sheet1").Range("C20:C40").Value but that gave Type Mismatch error.
 
Upvote 0
Rowsource needs an address, not an array of values.

Why are you enabling a listbox when you click on it?
 
Upvote 0
Oops, I was so busy trying to work out the error I overlooked I was addressing the wrong listbox.
Now Msg1 works. Sorry.... first time using this range-fill method instead of additem.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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