Hi so i did what you told me.
1) Made a new rule with the excel code.
2) Getting rid of the open close and save command.
-I did the code whit the open, close and save commands because when i didn't do it i've got some msgboxes that tel me that the file X1 ect is already open and when the code is done i have to save manualy and when i open excel i see that there is only value has been written to my excel.
3)I've put the update command where i think it should be good.
4)I deleted the excell links in the parameter menu.
5)In attachement you will find a small movie of my program showing my code ect.
Greetings
My new code
SyntaxEditor Code Snippet
If Start= True Then
Do While Afstand_tot_center_Ruit <5
Afstand_tot_center_Ruit= Afstand_tot_center_Ruit+0.5
InventorVb.DocumentUpdate(True)
'Define the excel columns A to D to write to:
Cell_X1="A" & Row_no
Cell_X2="B" & Row_no
Cell_Y1="C" & Row_no
Cell_Y2="D" & Row_no
Cell_H1="E" & Row_no
Cell_H2="F" & Row_no
'Write the values
GoExcel.CellValue("C:\Users\lowie\Documents\Inventor\laser_cladder_Lowie\X1.xls", "Blad1", Cell_X1) = X_Afstand_1_Ruit
GoExcel.CellValue("C:\Users\lowie\Documents\Inventor\laser_cladder_Lowie\X2.xls", "Blad1", Cell_X2) = X_Afstand_2_Ruit
GoExcel.CellValue("C:\Users\lowie\Documents\Inventor\laser_cladder_Lowie\Y1.xls", "Blad1", Cell_Y1) = Y_Afstand_1_Ruit
GoExcel.CellValue("C:\Users\lowie\Documents\Inventor\laser_cladder_Lowie\Y2.xls", "Blad1", Cell_Y2) = Y_Afstand_2_Ruit
GoExcel.CellValue("C:\Users\lowie\Documents\Inventor\laser_cladder_Lowie\Hoek_1.xls", "Blad1", Cell_H1) = Hoek_1_Ruit
GoExcel.CellValue("C:\Users\lowie\Documents\Inventor\laser_cladder_Lowie\Hoek_2.xls", "Blad1", Cell_H2) = Hoek_2_Ruit
Row_no= Row_no+1
Loop
End If