3.2 Library interface

The typical way of using this plugin is to deal with XLSX documents through the plugin's library interface. The library interface consists of a variety of functions that allow you to open and save XLSX documents, set and get cell values and other document and worksheet properties. For example, here is a script which creates an XLSX document that has 100 rows and 30 columns. The cell values will be set to a text string that contains each cell's column and row and the XLSX document will be saved as test.xlsx.

 
@REQUIRE "xlsx"
xlsx.Create(1, "test.xlsx")
For Local y = 1 To 100
   For Local x = 1 to 30
      xlsx.SetCellValue(1, x, y, "Cell " .. x .. "/" .. y)
   Next
Next
xlsx.Save(1)
xlsx.Close(1)

Alternatively, you can also use the plugin's serialization interface. This is easier because it only requires a single function call to convert Hollywood tables to XLSX documents and vice versa but you won't have fine-tuned control over everything as you have when using the library interface.

See the next chapter for more details on the plugin's serialization interface.


Show TOC