Is it possible to change the target file in “Excel Workbook” through custom code?
I need to change it for all of my defined exports.
Is it possible to change the target file in “Excel Workbook” through custom code?
I need to change it for all of my defined exports.
Hi Thomas,
If all of your exports are pointed at the same file you could also simply leave Excel Workbook value blank for all but the first export line. Then it will automatically use the value from the first line. Then if you ever need to change it again, you can simply change the path in the very first export to change them all.
You can use Lars's method to clear them all and then manually set the first export. - in the above case ExportLine1.
Table exports = getvarnode(model.find("Tools/ExcelAuto"), "exporttable"); for (int row = 1; row <= exports.numRows; row++) exports[row][1] = ""; //"C:\\MyNewFileLocation\\File.xlsx";
You can use
getvarnode(Model.find("Tools/ExcelAuto"), "exporttable").as(Table)[1][1]
to change the export target .xlsx file for the first export. Increment the table row for each export file.
I.e.
getvarnode(Model.find("Tools/ExcelAuto"), "exporttable").as(Table)[1][1] = "C:\\MyNewFileLocation\\File.xlsx";
Note that you need to use \\ in the file path, as a single \ will be deleted by the parser.
13 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved