EBDN - Community - Question & Answers

  Wednesday, 16 June 2021
  3 Replies
  1K Visits
0
Votes
Undo
hello everyone
Why can't I use the VBA code to delete the unspecified functions under the function folder.
My code is as follows:

Public Function DeleteDropAfterNothingFunction(ofunction As ObjectItem)
Dim oFuncs As ObjectItems
Set oFuncs = ofunction.FindObjects(aucObjFunction, aucSearchHierarchical)
Dim oFuncArr() As ObjectItem
oFuncArr = ObjItemsToArr(oFuncs)
Dim i As Integer
For i = 0 To UBound(oFuncArr)
If oFuncArr(i).Children.Count <= 0 Then
Call oFuncArr(i).Delete(False, aucDeleteTDeleteSheetAndRepresentationObjects)
End If
Next i
Exit Function
End Function


thank you