Excelwrite in Custom object

General Simio discussions. THIS IS *NOT* A GOOD PLACE FOR SUPPORT QUESTIONS.
To limit spam this and all Public Forums have very limited ability to attach files. We recommend that support issues and more technical topics be initiated inside one of the Simio Insider (SI) forums below where you can attach your model and see example solutions. See above Welcome forum to join Simio Insiders.
Post Reply
Moolman
Posts: 2
Joined: Thu Jul 07, 2016 5:15 am

Excelwrite in Custom object

Post by Moolman » Tue Jan 10, 2017 8:19 am

Hi,

I created a custom object with a process that uses the Excelwrite step. I created a Reference property for the Excel Workbook in the Excelconnect Element as well as a reference property for the Worksheet in the Excel Write step.

The idea is that when I use the custom object in my main model, I can define to which Excel Workbook and Worksheet the data must be written.

The problem I have is that if I have two (or more) custom objects in my main model referencing the same workbook, but different worksheets, the data only gets written to one sheet for one of the custom objects. In other words, the other custom objects' data is not being written down. If I then delete the other worksheets and only try one custom object writing to one worksheet,it works fine.

Should I have the data written down to multiple workbooks or is there a way to have multiple custom objects write to the same workbook on different sheets.

Any help or ideas are welcome!

KatieP
Simio Team Member
Posts: 27
Joined: Mon Jun 23, 2014 11:14 am
Contact:

Re: Excelwrite in Custom object

Post by KatieP » Thu Jan 26, 2017 11:42 am

You can accomplish writing to the same workbook but different sheets by doing the following:
1. Create an ExcelConnect on the top Model (not in custom object) and set the Workbook path.
2. On the ExcelWrite step in the custom object, right click "ExcelConnect" and select "Create New Referenced Property" this will add an Element type Reference Property to the Object. Also create a String Reference Property for the ExcelWrite step's WorkSheet property.
3. When you add an instance of the custom object to the top level model, set the Element property to "ExcelConnect1" and the String property to "SheetName"

There seems to be a problem with setting multiple ExcelConnects to the same excel file. I will talk to our Development team about this.

-Katie

gocken
Posts: 151
Joined: Tue Aug 02, 2011 1:59 pm

Re: Excelwrite in Custom object

Post by gocken » Thu Jan 26, 2017 2:35 pm

Would u upload your model pls? This problem should not be occured. If the problem is not caused by simio itself the solution suggested here will also be a guide to others, as well.

Moolman
Posts: 2
Joined: Thu Jul 07, 2016 5:15 am

Re: Excelwrite in Custom object

Post by Moolman » Thu Feb 02, 2017 3:38 am

Thank you Katie, your solution worked perfect!

Post Reply