Topic
Do while problem comcerning Cells
Page d'accueil ' Communauté ' Automation et VBA ' Do while problem comcerning Cellules
- Ce sujet contient 4 réponses, 2 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
-
03.11.2005 à 20:46 #35008Christian MuschelknautzParticipant
Hello again,
could you please explain to me, why this loop only works porperly until about “do while b < 10000": [code] Sub test() Dim aDataset As DataSet Dim b As Long b = 1 Dim fYFirstValue Set aDataset = ThisDatabase.RootFolder.Object("Time", fpObjectTypeDataSet) Do While b < 10000 fYFirstValue = aDataset.Value(fpDataComponentY, 1, b) b = b + 1 Loop Debug.Print fYFirstValue Debug.Print b End Sub[/code] My data row consits of about 2 Mio entries. Is there a way to change my liuttle macro in order to make it work? Thanks!
03.11.2005 à 20:46 #35012Christian MuschelknautzParticipantHello again,
could you please explain to me, why this loop only works porperly until about “do while b < 10000":
[code]
Sub test()
Dim aDataset As DataSet
Dim b As Long
b = 1Dim fYFirstValue
Set aDataset = ThisDatabase.RootFolder.Object("Time", fpObjectTypeDataSet)
Do While b < 10000
fYFirstValue =
aDataset.Value(fpDataComponentY, 1, b)b = b + 1
Loop
Debug.Print fYFirstValue
Debug.Print b
End Sub[/code]My data row consits of about 2 Mio entries. Is there a way to change my liuttle macro in order to make it work?
Thanks!
04.11.2005 à 18:20 #35009Bernhard KantzParticipantThis sample code should work.
Please send your FlexPr database with the macro to
support@weisang.com04.11.2005 à 20:19 #35010Christian MuschelknautzParticipantIt actuallay works, but after about 10000-100000 entries it’s getting very slow. Thus going through 2 Mio entries means probably several hours of waiting, without even calculating anything during this period of time.Just checking the data row.
09.11.2005 à 01:53 #35011Bernhard KantzParticipantWith every enlargement of the data set, FlexPro has to copy the values internally, which is very expensive, particularly with larger data sets. Furthermore the data volume which is transferred to the Automation interface of FlexPro per access, is very low. You can avoid these problems by first gathering the data in an array and then transferring its content as a whole.
[code]
Dim Data(1000000 – 1) As DoubleFor i = 0 to 100000 – 1
Data(i) = NewValue
Next
With DataSeries
.NumberOfRows = .NumberOfRows + 1000000
.Range(fpDataComponentY, , .NumberOfRows – 1000000 + 1, , .NumberOfRows).Value = Data
End With
[/code]
See Online Help
Working with a data set
Support@weisang.com -
AuteurMessages
- Vous devez être connecté pour répondre à ce sujet.