EBDN - Community - Question & Answers

  Thursday, 07 June 2018
  3 Replies
  8K Visits
0
Votes
Undo
Hello to everybody,
I have a question about function window symbol designed in a sheet and it's association with a function.
It is possible to associated with function window symbol with a different function during runtime ?
I have always an error when the sa.Role is equal to aucRoleSymbolInSheet

With a code most likely so:

Dim oFind as ObjectItems
Dim oDev as ObjectItem
Dim sa as Association

oDev = Application.Selection(1)
Set oFind = oDev.Project.FunctionsFolder.FindObjects(aucObjFunction, aucSearchFlat, aucFctPlant, aucAttrDesignation, aucCondEqual, oDev.Name)
if oFind.Count > 1 then
For each sa in oDev.SourceAssociations
oDev.SourceAssocations.Delete sa.Role, sa.RelatedObject
oDev.Store
oFind(1).SourceAssociations.New sa.Role, sa.RelatedObject
oFind(1).Store
Next sa
Endif