Home > Community > Automation and VBA > FlexPro Crashes > Antwort auf: FlexPro Crashes


To test the stability of FlexPro, I designed a very simple programme that creates formula’s and evaluates them as datsets. The programme doesn’t stop untill it crashes.
I ran the programme several times at it crashes every time with the message “Method ‘Add’ of object ‘IFolder’ failed”
Run 1: 10166 cycles
Run 2: 10045 cycles
Run 3: 9593 cycles
Run 4: 8762 cycles
Run 5: 7432 cycles
Run 6: 9932 cycles (restarted FlexPro before this run => memory cleared)

The source code:

Option Explicit
Private Sub CommandButton1_Click()
Dim i As Integer
i = 1
Do While i > 0
With ActiveDatabase.ActiveFolder.Add(i, fpObjectTypeFormula)
.Formula = 1 * 5
End With
i = i + 1
TextBox1.Text = i
End Sub

The programme form consists of a button (start) and a textbox that displays the cycle number.
After the crash I delete the datasets manually. I select all the datasets and press ‘Delete’. FlexPro then comes with the message “There is insufficient memory available to complete operation”. Checking the memeory reveals that of the 512 Mb memory 230 Mb is still available. The PC is using Windows XP Professional and FlexPro 6.0.28

I designed this programme because my main programme crashed after a while for no obvious reason at a location in the code it executed many times before without problems.
What causes this error and what can I do to solve it ???