Xlsx Import/Export plugin

Xlsx Import/Export plugin - share data between SMath Studio and XLSX spreadsheets - Messages

#1 Posted: 6/10/2013 3:49:00 AM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

SMath Studio compatibility SMath Viewer compatibility mono compatibility

extension page Sources MIT license


Here there is a plugin to share data between SMath and XLSX Spreadsheets (*.xlsx, *.xlsm).

Plugin UI languages: English Deutsch Italiano Русский Español

PLEASE REPORT IN THIS TOPIC ANY ISSUE.


Best regards

  • requirements: SMath Studio 0.96.4909 or later, .Net Framework 3.5 (Windows) / Latest Mono distributive (Linux);
  • installation: download the plugin from the gallery;
  • documentation: XlsxImportExport_docs.7z (38 KiB) downloaded 1399 time(s).;
  • languages: if you want to have a new UI language look into the documentation's Language folder.



Attached below OLD documentation for SMath Studio prior to 0.97.5346 (0.96.4909 <= SS < 0.97.5346)
XlsxImportExport_docs.7z (37 KiB) downloaded 1118 time(s).
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
9 users liked this post
subseapark 1/10/2018 8:03:00 PM, ioan92 6/10/2013 4:16:00 AM, Вячеслав Мезенцев 6/10/2013 6:40:00 AM, Andrey Ivashov 6/10/2013 3:11:00 PM, IVR 6/10/2013 3:32:00 PM, zoom 1/17/2016 5:15:00 PM, justhumm 12/6/2016 8:37:00 PM, Radovan Omorjan 6/10/2013 3:59:00 AM, Serg 6/10/2013 7:08:00 AM
#2 Posted: 6/10/2013 5:07:53 AM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

thank you for the feedback


best regards,

Davide
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#3 Posted: 6/10/2013 6:45:09 AM
genf

genf

6 likes in 72 posts.

Group: User

How to use this plugin - did not quite understand. Thank you.
#4 Posted: 6/10/2013 6:50:31 AM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

Wrote

How to use this plugin - did not quite understand. Thank you.


Examples added to the first post (XlsxImportExport_docs.7z - nothing changes in the usage from those contained in the previous Data Exchange plugin)

Attached here a pdf to show the expected output.


regards,

w3b5urf3r
Xlsx Import_Export examples.pdf (62 KiB) downloaded 1812 time(s).
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 users liked this post
Serg 6/10/2013 7:08:00 AM
#5 Posted: 6/10/2013 7:03:52 AM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Wrote

How to use this plugin - did not quite understand. Thank you.


All plugin functions are explained in the function reference part of the handbook (see signature). It is in german, but the examples should be self documenting (most of them in fact taken from Davide's examples)
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 users liked this post
Serg 6/10/2013 7:21:00 AM
#6 Posted: 2/2/2014 11:52:57 PM
Ernesto

Ernesto

13 likes in 74 posts.

Group: User

I tried this plugin out, since importing and exporting to excel would be extremely useful.

However when I try to import a cell with a function referencing another cell, the cell reference is imported (eg: A5*G4), instead of the value of the cell. Is there any way around this?

Also, is it possible to export to an existing excel file, without overwriting it? I tried exporting to an existing file, and everything in the file gets erased, except for the newly exported data.


Thanks,

Ernesto.
#7 Posted: 2/3/2014 1:56:49 PM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

I need to see the ClosedXML API references...

About cell's references if I remember correctly there are some limitations (not all the functions are supported and not all the references, f.e. between different sheets) but I can check if something can be made...

For both the things, I'll see what I can do
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#8 Posted: 4/6/2014 9:49:33 AM
Ryan Freund

Ryan Freund

19 likes in 339 posts.

Group: User

In the example file it is stated
Quote

import a single cell
(file in the same folder of this sheet; use a relative/absolute path otherwise)



Does this mean if the file is in the same folder as SMath?

It appears that the program looks where the Smath.exe file is stored is that correct?
Thanks

EDIT:

I wanted to use the folder where the calulcation page and the excel sheet was stored. Therefore I should first set CurrentDirectory(DocumentDirectory(""))
#9 Posted: 4/6/2014 10:48:17 AM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

Wrote

In the example file it is stated

Quote

import a single cell
(file in the same folder of this sheet; use a relative/absolute path otherwise)



Does this mean if the file is in the same folder as SMath?

It appears that the program looks where the Smath.exe file is stored is that correct?



The "base" path is the path of the worksheet, if available (existing worksheet) otherwise is the user "Documents" folder.
The archive in the first post contains some import/export examples.


BTW the path of the executable has no much interest (in most of the cases the user don't know where it is or needs administration privileges to write inside it)


Best regards,

Davide
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#10 Posted: 5/18/2014 11:45:37 AM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Is the Excel import meant to be Viewer-safe? I get the attached error message if I try to run a viewer application with excel read. With ods-format the situation is similar.
xlsx.PNG
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#11 Posted: 5/18/2014 6:12:19 PM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

Wrote

Is the Excel import meant to be Viewer-safe? I get the attached error message if I try to run a viewer application with excel read. With ods-format the situation is similar.



To be honest, I've never tried these plugins in SMath Viewer; seems that the external assemblies are not embedded in the Viewer.

As secondary thing reading the ClosedXML/Ionic.Zip licenses I suppose that any Viewer executable shall contains the relative copyright notice, and this actually is not possible (if this is not made by you manually)...
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 users liked this post
Martin Kraska 5/19/2014 2:45:00 PM
#12 Posted: 5/19/2014 2:49:19 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

I try to setup a data browser for use by my colleagues, therefore any hints on how to do viewer-safe data import of spreadsheets are welcome. Perhaps this could be done within excel, but I am not comfortable with it and just use the opportunity to do some SMath testing.
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#13 Posted: 5/19/2014 6:07:46 PM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

Nice idea...

Added in the BTS as SV-146 and SV-147


Best regards,

Davide
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#14 Posted: 8/5/2014 11:56:26 AM
msiseminger

msiseminger

1 likes in 1 posts.

Group: User

Davide,

The issue with "DocumentFormat.OpenXml.dll" not found when you create and run an .exe can be resolved by removing the reference to the .dll from the "References" section in your extention solution. You do not call this .dll anywhere in the extension so it is not needed. When I do this, I no longer get the missing .dll error.

The .exe still does not pull in the Excel spreadsheets I want with the missing .dll error fixed. I did do further investigation and the .exe program can not handle even a simple mat() function by itself with no other references. This lead me to believe that the .exe program is at issue and not your extension.

Mike
1 users liked this post
Davide Carpi 8/5/2014 2:05:00 PM
#15 Posted: 3/7/2015 10:05:02 AM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

PLUGIN UPDATED

- ImportData.XLSX now get results where cells references other cells;
- fixed export on SMath Viewer;
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#16 Posted: 3/11/2015 3:26:49 PM
Alexander O. Melnik

Alexander O. Melnik

127 likes in 494 posts.

Group: Moderator

I figured this conversation is best to be continued here

Wrote

COM plugins are a unexplored field for me. My first idea is to have something like a Calculate.MSExcel("file") / Calculate.LOCalc("file") functions; I don't know if this is possible for the whole document, anyway should be possible for a range Calculate.XYZ("file","cells").

Base documentation:
- for excel: How to: Run Excel Calculations Programmatically
- for LO: SDK 4.3: Common Language Infrastructure (CLI) examples



Is it possible to run visual basic script from your plugin? I have come up with (pieced together from numerous online sources) a .vbs file that will update (in background) all the XLSX files in the directory it is run from (it will actually run a background EXCEL process that can be tasked to do anything excel can). If this or similar could be incorporated in your plugin I can see following happening:

1. Modify "input" xlsx workbook using your data exchange plugin
2. Run .vbs script that will recalculate/save all workbooks linked to input work book (I wonder if it is possible to somehow start the sript from within Smath)
3. Export cell range from desired workbook

I am sure with .vbs there is a way to perform all input - calculations - output strictly in memory, so no files need to be saved unless desired. I am not sure, however, if it is something that can be used by a Smath Studio plugin.

Best regards
SpreadSheet IOxlsx.7z (11 KiB) downloaded 132 time(s).
#17 Posted: 6/25/2015 3:39:07 PM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

PLUGIN UPDATED SMath Studio 0.97.5581

- import data: fixed bug when quotation mark (") is used in a cell, f.e. for inches measurements. Now this character is converted in the "Double Prime" character (″) [many thanks to Don Bollard for pointing out this bug];
- import data: importData.XLSX(3) now accepts a range of cells as third argument (f.e. "A3:B12");
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#18 Posted: 1/20/2016 1:32:54 PM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

PLUGIN UPDATED SMath Studio 0.97.5737

  • importData.XLSX() can access files opened by other processes (only saved data);
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 users liked this post
ioan92 1/20/2016 2:08:00 PM
#19 Posted: 4/17/2016 7:43:28 AM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

PLUGIN UPDATED SMath Studio 0.97.5346 and later

- added exportData.XLSX(4)* [extends exportData.XLSX(2)];
- added exportData.XLSX(5)* [extends exportData.XLSX(3)];
- importData.XLSX(...): fixes in path processing;


* How they works:
- If the file doesn't exists, a new file is created;
- If the sheet in the workbook doesn't exists, a new sheet is created;
- If the sheet exists in the workbook, data in the target cells will be overwritten; use these functions with caution if your output may have a different size at each run;
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#20 Posted: 4/17/2016 2:44:14 PM
Ruben Sidranski

Ruben Sidranski

17 likes in 463 posts.

Group: User

Does this or any other "excel" plugin work with "ods" extensions? I am on Libre office on both Windows and Linux at home. I could not get to work.
  • New Posts New Posts
  • No New Posts No New Posts