[id] = xlsx.Open(id, filename$)
filename$
and
assigns id
to it. If you pass Nil
in id
, xlsx.Open()
will automatically
choose a vacant identifier and return it. The file specified in filename$
must exist or this function will fail. If you want to create a new xlsx
document, use the xlsx.Create() function.
Although xlsx.hwp will automatically close all open XLSX documents when it quits, it is strongly advised that you close an open XLSX document when you are done with it using the xlsx.Close() function because otherwise you are wasting resources.
Note that xlsx.Open()
will create a standard Hollywood object which can
also be used with functions from Hollywood's object library such as GetAttribute()
,
SetObjectData()
, GetObjectData()
, etc. See xlsx.GetObjectType for details.
Nil
for auto id selectionNil
as argument 1 (see above)xlsx.Open(1, "test.xlsx") cols = xlsx.GetColumnCount(1) rows = xlsx.GetRowCount(1) For Local y = 1 To rows For Local x = 1 to cols DebugPrint((xlsx.GetCellValue(1, x, y))) Next DebugPrint("************************") Next xlsx.Close(1)The code above opens
test.xlsx
and prints the values of all cells.