Table Generator

Table Generator - running/recording an SMath sheet multiple times - Сообщения

#21 Опубликовано: 12.04.2016 14:12:21
Kemili

Kemili

1 сообщений из 10 понравились пользователям.

Группа: User

Ernesto,

Yes that does what I intended, but it is not what I needed. I had that Script Region (SR) there for the reason that I want to find the way to use it to assign dynamic values to my inputs to do this, instead of the static values you interpreted my example as. There will be far more inputs and variations of their values in my sheets.

I understand how to use loops to reach this result. I had said before that I could very well utilize the functions (loops too), and whatnot, in SMath like that, but it would require rewriting numerous of my current SMath sheets. I'm not dismissing that direction, but I am looking for anything that might allow me to use my sheets as-is (or minimal editing).


Within this SR code I'm trying to
1.access/change select values on the sheet, and
2.calculate the sheet with those new values to get select values, via the SR, which I'm using VB.NET.

I can pull the values with the object SMath.Manager.Definition. Where can I change them within this code? And how do I calculate the sheet?
#22 Опубликовано: 12.04.2016 14:38:15
Alexander O. Melnik

Alexander O. Melnik

127 сообщений из 494 понравились пользователям.

Группа: Moderator

Kemili,

The right way of going about your task is to create a user defined function that takes input and produces output. If you were to do that you will also see increase in calculation performance as well (my own experience).

- get input (from excel or elsewhere)
- loop through your custom number crunching function
- record output (to excel or elsewhere)

What you are asking to do (use .sm worksheet as a function) is probably doable, however it is not the SMath way of appraoching your problem. You are likely to spend more time figuring out how to do it the undocumented (read wrong) way, than to sit down, and copy paste line by line all your .sm worksheet formulas into one single function.

... ANd it looks like Davide just published the plugin that matches your request. Check it out ;-)
http://en.smath.info/forum/yaf_postst7452findunread_Run.aspx
1 пользователям понравился этот пост
Kemili 13.04.2016 13:32:00
#23 Опубликовано: 12.04.2016 16:31:40
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Ernesto,

Soory kamarad, nothing works, except for yourself.

There is an unconfessed/unattended bug in reading *.xlsx

Jean

Forum Bug XLSX.gif
#24 Опубликовано: 13.04.2016 13:31:47
Kemili

Kemili

1 сообщений из 10 понравились пользователям.

Группа: User

Alex,
I agree that going the way of the user defined function may have been the best way to go about my problem, but I was seeing if there was a different way ('cause I'm stubborn ) that would be less work. And I would have done it in the end too, if it were not for your edit pointing me to Davide's new plugin!
It turns out, with a tiny bit of editing of my current sheets, and with the use of as much of a generic "runner" sheet I can concoct (to work with all of my sheets), I can very well do what I wanted without outright revamping all of my sheets! Thank you very much for that note!


Jean,
I think the problem for your use of importDataXLSX() might be the actual inputs in there. The pop-up comment on these all say the first value should be a "path" (at least in English), but I've only got it to work by combining the path and the excel name - the filepath.

So assuming your book is in a folder called EXCEL on your C drive, and your sheet name is "Sheet1", try:
importDataXLSX("C:\EXCEL\Book2.xlsx", "Sheet1" )

However, if that "access to path.." is the true culprit, I'm unsure how to get around that aside from using a different folder path.
1 пользователям понравился этот пост
Davide Carpi 13.04.2016 14:08:00
#25 Опубликовано: 13.04.2016 14:10:41
Davide Carpi

Davide Carpi

1416 сообщений из 2873 понравились пользователям.

Группа: Moderator

Wrote

importDataXLSX("C:\EXCEL\Book2.xlsx", "Sheet1" )


correct

Wrote

However, if that "access to path.." is the true culprit, I'm unsure how to get around that aside from using a different folder path.


The error you see is driven by the underlying CLosedXML plugin (I have the same using Jean's syntax in a folder on my system), I'll add a preventive check in the next update to avoid this cryptic error message.
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений