Jump to content
Moolman

Excelwrite in Custom object

Recommended Posts

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!

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×