cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation Interface - Excel

Re: Automation Interface - Excel

I have attached the MathCAD file and the worksheet. I have tried a single variable and no luck.

Ron S.

Re: Automation Interface - Excel

I don't have a version of Excel that can create .xlsx files, so there's a limit to what I can do (I can read them, but not write them). It works fine if I change the name of the output file, so there's something it doesn't like about your Excel sheet. What happens if you change the sheet so that it also has a value in cell A1?

Re: Automation Interface - Excel

Richard,

You got it again......I pulled the data up one row and then Tools/calculate and it worked. Now I need to figure out how to get the writeexcel function to put the data into different cells. By default it puts it into the A column. The read function seems okay and versatile, but the write function seems a little picky on where it can put the data.

Thank you

Ron S.

Re: Automation Interface - Excel

If Mathcad is the computing device and gets data from Excel, Mathcad will run new calculations on the click to READPRN and it will iterate through all the work sheet and you will WRITEPRN for the result. Once calculations are updated and written to file they are there but not yet in Excel. To get the updated results in Excel, use the "Update option in Excel". It might be also that you don't need Mathcad if Excel can do or vice versa.

jmG

Re: Automation Interface - Excel

Ron Shoemaker wrote:

Richard,

You got it again......I pulled the data up one row and then Tools/calculate and it worked. Now I need to figure out how to get the writeexcel function to put the data into different cells. By default it puts it into the A column. The read function seems okay and versatile, but the write function seems a little picky on where it can put the data.

Thank you

Ron S.

Ron,

To output to selected worksheets in the file, you need to pass the sheet name, and then select the desired sheet (instead of the first one).


For multiple items you could just call the component for each one. But it's faster if you set it up as a data array and loop through the rows.


Note that the whole process will be a lot faster if you have Excel running, as the component uses Excel and will start (and implicitly close) it if it is not running.

For multiple items you could just call the component for each one. But it's faster if you set it up as a data array and loop through the rows.


Note that the whole process will be a lot faster if you have Excel running, as the component uses Excel and will start (and implicitly close) it if it is not running.

Have a look at the attached worksheet taken from the old collab.

Re: Automation Interface - Excel

Now I need to figure out how to get the writeexcel function to put the data into different cells. By default it puts it into the A column.

The WRITEEXCEL function doesn't allow you to choose the cells. It always starts at A1. You will have to use the component Mike posted.

Re: Automation Interface - Excel

Richard Jackson wrote:

Now I need to figure out how to get the writeexcel function to put the data into different cells. By default it puts it into the A column.

The WRITEEXCEL function doesn't allow you to choose the cells. It always starts at A1.

Richard,

I have posted an example above which the user can use as an alternative to the WRITEEXCEL function.

He could also being his data into Excel using WRITEEXCEL and then call the required variables to the required place within Excel, just using the = function. This would only work is the numbers of elements being passed to Excel stayed the same though.

Mike

Re: Automation Interface - Excel

Richard,

I have posted an example above which the user can use as an alternative to the WRITEEXCEL function.

Yes, I ralized that after I wrote my post. Once again, an example of "it's too hard to see what's new!"

And, as a side note, my cursor has vanished! I have seen this a few times when I am in the compose dialogue. It makes it very hard to edit something you have already written!

Re: Automation Interface - Excel

Richard Jackson wrote:

Yes, I ralized that after I wrote my post. Once again, an example of "it's too hard to see what's new!"

Unless I respond to each notification I receive I loose total track of what's going on in each thread. But receiving notifications for all categories is a joke, as I received over twenty e-mails last night while away from my computer.

Mike

Announcements