[FREE] ExcelTool a tool for working with xls files (Excel 97-2003 type)

Hello everyone I’m sharing my new extension called ExcelTool.
To implement this extension
With this extension, you can directly read or write cells in Excel spreadsheets.
To implement this idea, I used the library jxl.jar (A Java library for reading/writing Excel - Browse Files at SourceForge.net if anyone would be interested)
The library has its own weight, so the extension is not small. Due to the library’s features, the extension works with XLS files, but not with XLSX files. To work with the latter type of files, you need to attach an even larger library, which is completely unjustified.
One more time. the extension works with XLS files (Excel 97-2003 format)

now briefly on the expansion blocks with examples:
Read
filePath - the full path to the file. the example uses a third-party extension.
ListName- the name of the sheet in the table.
row , col - the requested cell
write
filePath - the full path to the file. the example uses a third-party extension.
ListName- the name of the sheet in the table.
row , col - cell coordinates
value the write value
listsname
array of values of all sheets in the xls file

searches for the specified value in the file. the result is reflected in the event. the format of the record will mean the coordinates of the cell. (for example 1-2 means row=1 and col=2)
exacMatch search for a complete match (true) or anything that contains the specified value partially (false)


converts file data to csv format

converts file data csv to xls file (excel format)

image
SearcResult event if there is no search result (does not find a value or text) returns the value 0 or the coordinates of the found value (array)

if you have any questions, write in the comments. I tried to make the extensions very clear :slight_smile:

download:
version 1:ExcelTool.aix (918.1 KB)
version 2:ExcelTool_v2.aix (918.4 KB)

version3:
This version has been completely redesigned and contains updated code that includes automatic file type detection and SAF processing for working with files. The extension is now completely offline and does not require additional extensions to work with local files. it takes into account the work with SAF files (android version).
the blocks had to be completely changed, and the logic of the work too. so the updated blocks:


the block for specifying the file to be operated on. depending on the android version, the procedure will be determined . i.e. either the path will be accepted as specified (for android below 12) or a file selection dialog will be offered (for Android 12+). the event that follows after the function is executed will be reflected.

after specifying the file, you can perform read, write, search, and convert actions. I have set a corresponding event for each function. these are the function blocks with the response events:

reading from the specified cell:


writing to the specified cell:

searching for a value:

creating a new file:

file conversion:

download:
ExcelTool_v3.aix (923.7 KB)

version 4:com.ExcelTool.aix (367.0 KB)

The size of the extension has been significantly reduced due to the use of an alternative library and optimization, blocks for working with asset files have been added.
important! if you are working with asset files, then you cannot change them, you can only read information from them. here are the new blocks:

6 Likes

Good job @11119

Looks great, congratulations!

However the example screenshots do not make much sense, because files in the assets are read-only after building the app…

Taifun

2 Likes

nice work :heart:

1 Like

Wow Thank you

version 2. Added the function of creating an xls file

Screenshot_2

ExcelTool_v2.aix (918.4 KB)

3 Likes

If you are using rush, you can use rush build -o to reduce size of extension, i think (918.4 KB) is so big

unfortunately
, the extension based on this library could not be reduced. She’s all involved there.

1 Like

Can you help me ?

I want to open the excel file in the download directory and convert it to csv extension. Then I will process the data in that file. I couldn’t do anything with the file. I cannot get the path information of the file and I cannot connect with the excel extension.

On devices running Android 12 and above, there have been changes in file system access. You cannot directly access shared directories such as /storage/emulated/0/Download without special permission.

I recommend viewing the SAF extension topic if you want to bypass this permission, which is dangerous from the point of view of Google.

does the plugin allow me to save an xlsx file on my company disk?

I don’t understand the question

does the plugin save files on your phone or tablet? or you can also save to an external location such as Google Drive

  1. I don’t understand what plugin you are talking about Write?
  2. This is an extension for working with xls files, not xlsx files.
  3. External links, such as those pointing to files on Google Drive or other cloud services, will not work directly with this code. The code is designed to work with local files on the device . To work with files stored on Google Drive or other cloud services, you must use the appropriate APIs of these services. For example, for Google Drive, you need to use the Google Drive API for authentication, access, and file management.

He is referring to SAF extension.

Yes, but that’s usually not needed.
You can create document files without any permission. SAF is needed only to access documents created by other apps.

No.

1 Like

I have created an updated version of the extension (see version 3), which should solve similar problems without involving additional extensions.

how to read the xls file from assets

put just filename with like
example.xls

I do not know for what purposes to read data from the table in assets :roll_eyes:, but I added new blocks for this (see version 4)