Permission denied, sometimes, when writing an array to listbox...why?

khervey

New Member
Joined
Nov 24, 2014
Messages
8
This line of code sometimes results in a "permission denied", but other times it works fine.

Code:
UserForm5.ListBox1 = arrayOutput

Seeking help/ideas/suggestions
 
Last edited:

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
This line of code sometimes results in a "permission denied", but other times it works fine.

Code:
UserForm5.ListBox1 = arrayOutput

Seeking help/ideas/suggestions
[Untested] What happens if you try it this way...

UserForm5.ListBox1.List = arrayOutput
 
Last edited:
Upvote 0
[Untested] What happens if you try it this way...

UserForm5.ListBox1.List = arrayOutput


Rick,

My apologies to you and all. My actual listbox name is way too long, so I shortened it and accidentally wrote over ".List". Actually, I think without ".List" it would never work.

That is the way that works when it works. The Sub loads up the array then writes to the list box. I can run it over and over again successfully, but then when I do something else in some other sub, it fails. I will dig into the other code, but I can't imagine anything else making the listbox have no permission.

I have tried unload, hide, show and such. I just can't imagine what would case a listbox to deny a permission
 
Upvote 0
Check that you haven't set RowSource anywhere
 
Upvote 0
As Fluff mentioned, I have only ever seen that happen if you have set the Rowsource to load the control from a range.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,176
Members
453,021
Latest member
Justyna P

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