After opening the files you posted and seeing how complicated the situation was, I decided to create my own simpler model file to test this process on first. In part you posted, I was also getting an error message every time I attempted to change that driving parameter's value from the Parameters dialog box, but not when doing so from the iLogic Form, for some reason. So I created a simple rectangle and extruded it, resulting in 3 total model parameters (Width, Depth, & Height). With Width being the driving parameter, and Depth = Width/2, and Height = Depth/2. When I finally got all the kinks worked out, then I migrated the proposed solution over to your posted part, and made the necessary adjustments.
This code only writes two parameters out to the Excel file right now, but it shows you how to do it, so you can continue to customize it to suit your needs. Full/complete solution would require way too much time investment for some random person on the forums to spend on someone else's unique challenge...and I'm leaving for the day, so...
Here's the iLogic rule for what I've got so far:
AddReference "Microsoft.Office.Interop.Excel.dll"
Imports Microsoft.Office.Interop.Excel
Sub Main
GetExcel 'runs the Sub below which sets the value of oExcel variable
'Get/Create a Workbook (file) to work with
If oExcel.Workbooks.Count = 0 Then
oWB = oExcel.Workbooks.Add()
Else
oWB = oExcel.ActiveWorkbook
End If
'Get/Create a Worksheet (a sheet/tab) to work with
If oWB.Worksheets.Count = 0 Then
oWS = oWB.Worksheets.Add
Else
oWS = oWB.ActiveSheet
End If
oCells = oWS.Cells
'specify the two column headers in first row of Excel sheet
'First number is Row index, second number is Column Index
oCells.Item(1, 1).Value = "RESTSTROOK"
oCells.Item(1, 2).Value = "RESTHOOGTE"
Parameter.UpdateAfterChange = True
MultiValue.UpdateAfterChange = True
'set driving parameter to its lower limit to start
Parameter("RESTSTROOK") = 65 mm
RuleParametersOutput
Dim oV1, oV2 As Double
'define amount to increment driving parameter's value per loop
Dim oInc As Double = 1 mm
'the following starts the loop
Do While Parameter("RESTSTROOK") <= 184 mm
oV1 = Parameter("RESTSTROOK")
oV2 = Parameter("RESTHOOGTE")
WriteValsToExcel(oV1, oV2) 'runs the Sub below
'increment the driving parameter, before looping again
Parameter("RESTSTROOK") = Parameter("RESTSTROOK") + oInc
RuleParametersOutput
Loop
'Make the width of all columns fit their contents
oWS.Columns.AutoFit
End Sub
Private oExcel As Microsoft.Office.Interop.Excel.Application
Private oWB As Microsoft.Office.Interop.Excel.Workbook
Private oWS As Microsoft.Office.Interop.Excel.Worksheet
Private oCells As Microsoft.Office.Interop.Excel.Range
Sub GetExcel()
If oExcel Is Nothing Then
Try
'try to find an already running instance of the Excel Application
oExcel = GetObject(, "Excel.Application")
'MsgBox("Found an instance of the Excel Application already open.",,"")
Catch
'it wasn't found open, so create an instance of it (start the application)
'oExcel = New Microsoft.Office.Interop.Excel.Application
oExcel = CreateObject("Excel.Application")
'MsgBox("Created a new instance of the Excel Application.", , "")
Catch
MsgBox("Failed to Get/Create an instance of the Excel Application. Exiting.", , "")
Exit Sub
End Try
'If it hasn't exited the Sub by now, oExcel has already been defined now, so set a couple settings for it
oExcel.DisplayAlerts = False
oExcel.Visible = True 'if you don't use this, you won't see the application
End If
End Sub
Sub WriteValsToExcel(oVal1 As Double, oVal2 As Double)
'determine last used row on the sheet
Dim oLastRowUsed As Integer = oWS.UsedRange.Rows.Count
Dim oRow As Integer = oLastRowUsed + 1
'First number is Row index, second number is Column Index
oCells.Item(oRow, 1).Value = oVal1
oCells.Item(oRow, 2).Value = oVal2
End Sub
If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.
If you want and have time, I would appreciate your Vote(s) for My IDEAS 💡or you can Explore My CONTRIBUTIONS
Wesley Crihfield

(Not an Autodesk Employee)