-
FlexPro
- At a Glance
- Features & Options
- Applications
- All Advantages
- What’s New in FlexPro 2021
- Try FlexPro For Free
- FlexPro View OEM Freeware
- Buying Guide
- Login
- Language
-
-
-
- +49 6894 929600
- infoweisang.com
- Google Maps
- Products
- News
- Support
- Company
- Contact
- Login
- Language
-
-
-
- +49 6894 929600
- infoweisang.com
- Google Maps
Home > Community > Automation and VBA > Liste déroulante avec objet différent en VBA > Reply To: Liste déroulante avec objet différent en VBA
June 26, 2008 at 11:32 pm
#8601
![Bernhard Kantz](https://www.weisang.com/wp-content/uploads/2016/09/default_avatar.jpg)
Participant
Try this code:
ActiveDatabase.ActiveObject.Cursor(fpCursorMinX).Active = True
p1 = ActiveDatabase.ActiveObject.ActiveCursor.PositionIndex
ActiveDatabase.ActiveObject.Cursor(fpCursorMaxX).Active = True
p2 = ActiveDatabase.ActiveObject.ActiveCursor.PositionIndex
ActiveDatabase.ActiveObject.CursorActive = False
Dim Moy As StatisticQuantityAnalysis
Set Moy = ActiveDatabase.ActiveFolder.Add("Moy", fpObjectTypeStatisticQuantity)
With Moy
.DataSet = "beber[" & CStr(p1) & "," & CStr(p2) & "]"
.Quantity = fpStatisticQuantityArithmeticMean
.Update
End With
But in this case it’s easier to use FPScript instead of VBA!
1) Create a FPScript formula ‘beberSection’:
(beber)[Diagram.2D.Cursor(fpCursorMinX, 1).PositionIndex, Diagram.2D.Cursor(fpCursorMaxX, 1).PositionIndex]
2) Create a Mean analysis object with the data set ‘beberSection’.
If you change the position of the cursors FlexPro automatically recalculates the mean value of the new data part.