- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Dear all,
I have compiled to code below that aims to do the following thing:
-Write the values of certain parameters to certain cells in the excel file
-The excel file automatically calculates the values in two other cells
-2 parameters in Inventor should be filled with the two values from these cells.
The code does put the values from Inventor into the input cells in Excel, which then calculates the new values.
But then something strange happens, the code doesn't take the newly calculated values back to Inventor but the old ones that were previously there. If I open the worksheet between two runs it does display the newly calculated values but, somehow Inventor still takes the old ones
When I re-run the code once more, It still takes the values that were there before I first ran the code. The only solution to change the output values is to open the excel file and save the file. Saving the file via the Ilogic strong does not work.
Any help is appreciated!
Kind regards,
Niek
InventorVb.DocumentUpdate()
iLogicVb.UpdateWhenDone = True
Dim sFile As String = "C:\Users\niek\Documents\Map 1.xlsx"
'Writing of Inventor parameter to Excel
GoExcel.Open(sFile, "Sheet:1")
GoExcel.CellValue("F3") = "Type 1"
GoExcel.CellValue("F4") = Parameter("MA_C")
GoExcel.CellValue("F5") = Parameter("L")
GoExcel.CellValue("F6") = Parameter("B")
GoExcel.CellValue("F7") = Parameter("α")
GoExcel.CellValue("F8") = Parameter("BG")
GoExcel.CellValue("F9") = Parameter("BS")
GoExcel.CellValue("F10") = Parameter("BS_GO")
GoExcel.CellValue("F11") = Parameter("AT")
GoExcel.CellValue("F13") = Parameter("RE_AD")
GoExcel.CellValue("F17") = Parameter("BS")
GoExcel.CellValue("F18") = Parameter("BS_GO")
GoExcel.CellValue("F19") = Parameter("TB_MA")
'Reading of Inventor parameters from Excel
Parameter("BN_TT") = GoExcel.CellValue("L3")
Parameter("BN_KO") = GoExcel.CellValue("L5")
GoExcel.Save
GoExcel.Close
Solved! Go to Solution.