View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jamie Collins Jamie Collins is offline
external usenet poster
 
Posts: 593
Default Runtime Error 381 Couldn't set list property, invalid array index

(Newbillian) wrote ...

a runtime error comes up in the following line in the vba
code:

ComboDeptNum.List = Sheets("Definitions").Range("$J$1:$I$12")

It is the same thing if I specify a named range:
ComboDeptNum.List = Sheets("Definitions").Range("DeptList")


Try using the Range object's Value property, rather than the Range
object itself or its default property e.g.

ComboDeptNum.List = _
Sheets("Definitions").Range("$J$1:$I$12").Value

ComboDeptNum.List = _
Sheets("Definitions").Range("DeptList").Value

I'm a newbie to Excel vba but have more experience
with Access and never saw this 381 in Access.


In the Immediate Window:

? Err.Number
381

? Err.Source
Forms.ListBox.1

Perhaps you never used the MS Forms ListBox object in MS Access.

Jamie.

--