I am not the most advanced professor when it comes into loops so I am a little bit stuck here.
Normally I would use it like:
Dim ouLookup: Set ouLookup = CreateObject("MFilesAPI.Lookup")
Dim ouLookups: Set ouLookups = CreateObject("MFilesAPI.Lookups")
ouLookup.Item = ThisWorkbook.Sheets("Sheet1").Range("E1").Value
ouLookup.Version = -1
ouLookups.Add -1, ouLookup
ouLookup.Item = ThisWorkbook.Sheets("Sheet1").Range("E2").Value
ouLookup.Version = -1
ouLookups.Add -1, ouLookup
etc.
By this code we are adding user ID's to our collection ouLookups
that we will use later in this code:
' AssignedToUsers
oPropertyValue.PropertyDef = MFBuiltInPropertyDefAssignedTo
oPropertyValue.Value.SetValueToMultiSelectLookup ouLookups ' It is here
oPropertyValues.Add -1, oPropertyValue
Is it possible to built a loop code for adding user ID's? So it will do this operation in a loop from cell E1
to E35
:
ouLookup.Item = ThisWorkbook... ' Offset or something?
ouLookup.Version = -1
ouLookups.Add -1, ouLookup