HCell SDK Engine and Features
HCell SDK Basic Functions
HCell 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 |
|---|---|---|---|
| HCell SDK Initialization | SDK.Initialize | Function to load and initialize the HCell SDK engine | sdk.Initialize(); |
| Get HCell SDK Instance | SDK.GetInstance | Function that returns the HCell SDK instance | const instance = sdk.GetInstance(); |
| HCell SDK Release | SDK.Finalize | Function to unload the HCell SDK engine | sdk.Finalize(); |
| Read File from HCell SDK File System | SDK.ReadFile | Function that reads a file stored in the HCell SDK file system and returns it as a byte array | let buffer = sdk.ReadFile("/hnc/File/example.xlsx"); |
| Save File to HCell SDK File System | SDK.WriteFile | Function that saves a byte array as a file in the HCell SDK file system | sdk.WriteFile("/hnc/File/example.xlsx", buffer); |
| Rename File or Path in HCell SDK File System | SDK.RenameFile | Function that renames a file or path in the HCell SDK file system | sdk.RenameFile("/hnc/File/old.xlsx", "/hnc/File/new.xlsx"); |
| Remove File or Path from HCell SDK File System | SDK.RemoveFile | Function that removes a file or path from the HCell SDK file system | sdk.RemoveFile("/hnc/File/example.xlsx"); |
| Check if File or Path Exists in HCell SDK File System | SDK.ContainsFile | Function that checks if a file or path exists in the HCell SDK file system | if (sdk.ContainsFile("/hnc/File/example.xlsx")) { } |
| Create Directory in HCell SDK File System | SDK.CreateDirectory | Function that creates a directory in the HCell SDK file system | sdk.CreateDirectory("/hnc/Example"); |
| Check HCell SDK File System | SDK.ShowFileSystem | Function that outputs the HCell 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 `); |