Topic
Access to Cells via VBA
Page d'accueil ' Communauté ' Automation et VBA ' Accès aux cellules via VBA
- Ce sujet contient 6 réponses, 3 participants et a été mis à jour pour la dernière fois par Christian Muschelknautz, le il y a 19 années et 6 mois.
-
AuteurMessages
-
27.10.2005 à 21:56 #35013Christian MuschelknautzParticipant
Probably it’s pretty easy to answer my question, nonetheless here it is:
VBA in Excel permits users to access cells via the expression cells(a, b). Is there an equivalent in VBA for FlexPro? In my special case I want to compare variables with the content of cells.
Thanks for support!27.10.2005 à 21:56 #35019Christian MuschelknautzParticipantProbably it’s pretty easy to answer my question, nonetheless here it is:
VBA in Excel permits users to access cells via the expression cells(a, b). Is there an equivalent in VBA for FlexPro? In my special case I want to compare variables with the content of cells.
Thanks for support!27.10.2005 à 22:36 #35014Bernhard KantzParticipantUse the [b]Value[/b] method of the DataSet object.
[code]
Sub Example()
Dim oDataSet As DataSet
Dim V(2) As Double
Set oDataSet = ThisDatabase.RootFolder.Add(“data”, fpObjectTypeDataSet)
V(0) = 1
V(1) = 2
V(2) = 3
oDataSet.Value = V
End Sub
[/code]
See FlexPro Online Help
Automating Tasks
Automation with FlexPro Visual Basic
First Steps with FlexPro Visual Basic
Working with Objects
Working with Data Sets28.10.2005 à 00:48 #35015Christian MuschelknautzParticipantFirst of all thanks for the quick answer. Now I know how to handle “writing to cells” but how can I cope with reading them. In the online manual I could found this example:
Dim S As Signal
Set S = SignalDataSet.Value
Dim Delta As Double
Delta = S.X(1) – S.X(0)Could you please imbed it into a stand-alone example? Let’s say for a dataset called “Time” which has been imported.
Thanks again…I’m learning …28.10.2005 à 01:02 #35016Bernhard KantzParticipantHere is an example with a time signal which is in the root folder:
[code]
Sub ReadData()
Dim oDataset As DataSet
Dim fXValues, fYValues, fYFirstValue
Set oDataset = ThisDatabase.RootFolder.Object(“Time”, fpObjectTypeDataSet)
fXValues = oDataset.Value(fpDataComponentX)
fYValues = oDataset.Value(fpDataComponentY)
fYFirstValue = oDataset.Value(fpDataComponentY, 1, 1)
End Sub
[/code]
support@weisang.com28.08.2010 à 03:39 #35017Fiette SebastienParticipantHello,
Is it possible to copy the complete Y column of a signal into the X column of another signal, without doing a loop ?
Thanks
31.08.2010 à 19:47 #35018Bernhard KantzParticipantThis is possible. Create a FPScript formula with the script:
[code]
Signal(Signal1.Y, Signal2.Y)
[/code]VBA-Example:
[code]
Dim oFml As FormulaSet oFml = ThisDatabase.RootFolder.Add(“Formula”, fpObjectTypeFormula)
With oFml
.Formula = “Signal(Signal1.Y, Signal2.Y)”
.Evaluate
End With
[/code] -
AuteurMessages
- Vous devez être connecté pour répondre à ce sujet.