idk if it's possible, but you can set iproperties through an excel sheet, so i guess you could write to the sheet aswell if you just flip the order.
I have this iproperty value which is updated accordingly to a cell within a spreadsheet
iProperties.Value("Custom", "ItemNmbr") = GoExcel.CellValue(xSpec, "Driver","H14")
If you flip this so it looks like this:
GoExcel.CellValue(xSpec, "Driver","H14") =iProperties.Value("Custom", "ItemNmbr")
then i guess it could work. However you need to specify which excelsheet you want it to write to with GoExcel.open
then its just a matter of making a checkbox in a form which dictates if you want to write to spread sheet, or want to get cell information to iproperties.
Hope this makes sense..
Code could look like this (this code works for me atleast)
Dim oFileDlg As Inventor.FileDialog
Dim oDocFile As Document, oDocFileName As String
'Run File Selection Code
InventorVb.Application.CreateFileDialog(oFileDlg)
'Allow Selection Of Excel Files
oFileDlg.Filter = "Excel Spec Sheet (*.xls;*.xlsx;*xlsm)|*.xls;*.xlsx;*xlsm"
'Get File Path, setting the initial path to the same folder that the model is saved In.
oFileDlg.InitialDirectory = ThisDoc.Path
oFileDlg.CancelError = True
'Show Open File Dialog Window.
oFileDlg.ShowOpen()
If oFileDlg.FileName = ""
MessageBox.Show("No File Selected", "Error")
End If
'declares selected file name
Dim xSpec As String = oFileDlg.FileName
'Set Filename parameter to the path.
Parameter("Filename") = xSpec
GoExcel.Open(xSpec, "SHEETNAME")
'Print write parameter dictating wether to write or get information from/to excel
if Parameter(read_write) = true then
iProperties.Value("Custom", "ItemNmbr") = GoExcel.CellValue(xSpec, "(SHEETNAME","H14")
else if Parameter(read_write) = false
GoExcel.CellValue(xSpec, "(SHEETNAME","H14") = iProperties.Value("Custom", "ItemNmbr")
end if
GoExcel.save
GoExcel.close
I have not tested the use of this to write from iProperties to Excel, but i'd think it works the same way, as when you write from excel to iProperties, the code above where i get a cell value and write to a custom iProperty value works in my current project as it is right now.