Automated sequential Trails using VBA/COM

Automated sequential Trails using VBA/COM

Postby jv104 » Tue Jun 09, 2009 6:03 pm


I am trying to create an interface that will enable multiple trials of simul8 to be conducted each using different input parameters.

The parameters are obtained from Excel following various action taken on the data in VBA.

Currently I have code which works via use of buttons:

1. Opens Simul8
2. Imports data using GetExcel (in Simul8 open)
3. Runs a trial
4. Exports data back into Excel using SetExcel (in End of Trial)
5. Able to go to next trial repeat steps 2-4 on press of a button

Ideally I would like to automate the process so that I don't need the step 5 above. Is that possible?

What I have been working on/thinking about:

1. Run the above code 1-4 then quit Simul8
2. Run the non Simul8 VBA
3. Reopen Simul8 (when the value in a text box changes - VBA signal)
4. Go through steps 2 - 4 above
5. Then quit simul8

However I have a few problems when I do it this way. I receive an error message from Simul8 about not being able to communicate with the Excel sheet and I also have several Simul8 windows open.

Any pointers, guidance, or advice would be greatly appreciated.

Many thanks


Return to “SIMUL8 Cafe”