Spreadsheet SDK Engine and Features
Spreadsheet SDK Basic Functions
Spreadsheet SDK Basic Functions covers core SDK functionality including initialization, file loading and saving through the file system, path creation, and registration and removal of custom procedures.
It includes APIs that consider various integration scenarios, providing flexible developer-centric control.
| Function | API | Description | Example |
|---|---|---|---|
| Spreadsheet SDK Initialization | SDK.Initialize | Function to load and initialize the Spreadsheet SDK engine | sdk.Initialize(); |
| Get Spreadsheet SDK Instance | SDK.GetInstance | Function that returns the Spreadsheet SDK instance | const instance = sdk.GetInstance(); |
| Spreadsheet SDK Release | SDK.Finalize | Function to unload the Spreadsheet SDK engine | sdk.Finalize(); |
| Read File from Spreadsheet SDK File System | SDK.ReadFile | Function that reads a file stored in the Spreadsheet SDK file system and returns it as a byte array | let buffer = sdk.ReadFile("/hnc/File/example.xlsx"); |
| Save File to Spreadsheet SDK File System | SDK.WriteFile | Function that saves a byte array as a file in the Spreadsheet SDK file system | sdk.WriteFile("/hnc/File/example.xlsx", buffer); |
| Rename File or Path in Spreadsheet SDK File System | SDK.RenameFile | Function that renames a file or path in the Spreadsheet SDK file system | sdk.RenameFile("/hnc/File/old.xlsx", "/hnc/File/new.xlsx"); |
| Remove File or Path from Spreadsheet SDK File System | SDK.RemoveFile | Function that removes a file or path from the Spreadsheet SDK file system | sdk.RemoveFile("/hnc/File/example.xlsx"); |
| Check if File or Path Exists in Spreadsheet SDK File System | SDK.ContainsFile | Function that checks if a file or path exists in the Spreadsheet SDK file system | if (sdk.ContainsFile("/hnc/File/example.xlsx")) { } |
| Create Directory in Spreadsheet SDK File System | SDK.CreateDirectory | Function that creates a directory in the Spreadsheet SDK file system | sdk.CreateDirectory("/hnc/Example"); |
| Check Spreadsheet SDK File System | SDK.ShowFileSystem | Function that outputs the Spreadsheet SDK file system status to console in object format | sdk.ShowFileSystem(); |
| Add Visual Basic Procedure (Macro Recording) | SDK.AddVBProcedure | Function that adds a Visual Basic procedure in macro form | sdk.AddVBProcedure(` Sub Example() With ActiveSheet.PageSetup .Orientation = xlPortrait .Zoom = False .FitToPagesWide = 1 .FitToPagesTall = 2 .TopMargin = Application.InchesToPoints(0.5) .BottomMargin = Application.InchesToPoints(0.5) .LeftMargin = Application.InchesToPoints(0.5) .RightMargin = Application.InchesToPoints(0.5) End With Columns("A:H").ColumnWidth = 12 With Range("A1:H47").Borders(xlInsideVertical) .LineStyle = xlContinuous .ThemeColor = 1 End With With Range("A1:H47").Borders(xlInsideHorizontal) .LineStyle = xlContinuous .ThemeColor = 1 End With End Sub `); |
| Remove Visual Basic Procedure (Macro Removal) | SDK.DeleteVBProcedure | Function that removes a Visual Basic procedure | sdk.DeleteVBProcedure("Example"); |
| Execute Visual Basic Procedure (Macro Execution) | SDK.ExecuteVBProcedure | Function that executes a Visual Basic procedure | sdk.ExecuteVBProcedure("Example"); |
| Execute Visual Basic Script | SDK.ExecuteVBScript | Function that executes a Visual Basic script | sdk.ExecuteVBScript(` Cells.Clear ActiveSheet.Shapes.SelectAll Selection.Delete `); |