-
FlexPro
- Zoom sur FlexPro
- Fonctionnalités & Options
- Domaines d’application
- Tous les avantages
- Nouveau dans FlexPro 2021
- Testez FlexPro gratuitement
- FlexPro View OEM Freeware
- Conseils d’achat
- Login
- Langue
-
-
-
- +49 6894 929600
- infoweisang.com
- Google Maps
- Produits
- News
- Support
- Société
- Emplois
- Contact
- Login
- Langue
-
-
-
- +49 6894 929600
- infoweisang.com
- Google Maps
Accessing to calculated datas in VBA
Accueil > Community > Automation and VBA > Accessing to calculated datas in VBA
- This topic has 2 replies, 2 voices, and was last updated 8 years, 11 months ago by
HerveM1234.
-
AuthorPosts
-
August 11, 2015 at 3:20 pm #12889
HerveM1234
ParticipantHi,
What is the best way to access from VBA to datas calculated (or not) in FlexProScript.
I tried :
Dim toto1, toto2, toto3 Set toto1 = ActiveDatabase.RootFolder.Object("Formulas\myformula.FML", fpObjectTypeFormula).Value Set toto2 = toto1.X toto3=toto2(0) ' acces to the first xvalue of myformula for example
It seems to work fine
If I write
dim toto toto=ActiveDatabase.RootFolder.Object("Formulas\myformula.FML", fpObjectTypeFormula).Value.X(0)
it doesn’t work. Why?
This this code does not work either :
dim toto set toto = databases("MyDatabase.FPD").Object("Formulas\myformula.FML").value
Something wrong?
Thank you for the help
August 11, 2015 at 3:20 pm #8549HerveM1234
ParticipantHi,
What is the best way to access from VBA to datas calculated (or not) in FlexProScript.
I tried :
Dim toto1, toto2, toto3 Set toto1 = ActiveDatabase.RootFolder.Object("Formulas\myformula.FML", fpObjectTypeFormula).Value Set toto2 = toto1.X toto3=toto2(0) ' acces to the first xvalue of myformula for example
It seems to work fine
If I write
dim toto toto=ActiveDatabase.RootFolder.Object("Formulas\myformula.FML", fpObjectTypeFormula).Value.X(0)
it doesn’t work. Why?
This this code does not work either :
dim toto set toto = databases("MyDatabase.FPD").Object("Formulas\myformula.FML").value
Something wrong?
Thank you for the help
September 22, 2015 at 10:45 am #9407Bernhard Kantz
ParticipantThe first example won’t work since “value.X” does not exist for a FlexPro formula object. Instead, you have to use e.g.
Dim toto toto = ActiveDatabase.RootFolder.Object("Formula", fpObjectTypeFormula).Value(fpDataComponentX)(0)
Moreover, it is suggested to use early binding, e.g.:
Dim fml as Formula fml = ActiveDatabase.RootFolder.Object("Formula", fpObjectTypeFormula) Dim result as double result = fml.Value(fpDataComponentX)(0)
Finally, in the last example you should open the desired database first and should again use early binding. More details about the value property can e.g. be found in the FlexPro Online-Help under Automating Processes | Automation Using FlexPro Visual Basic.
-
AuthorPosts
- You must be logged in to reply to this topic.