Import From JSON - VB.NET
Spreadsheet SDK sample in VB.NET demonstrating ‘Import From JSON’
Module1.vb
Imports Bytescout.Spreadsheet
Imports System.IO
Module Module1
Sub Main()
Using spreadsheet As New Spreadsheet
' Load JSON string from file
Dim jsonString As String = File.ReadAllText("sample.json")
' Import JSON
spreadsheet.ImportFromJSON(jsonString)
' Save spreadsheet
spreadsheet.SaveAsXLS("result.xls")
' Open the result file in default associated application
Process.Start("result.xls")
End Using
End Sub
End Module
sample.json
[
{
"Column 1": "1",
"Column 2": "2",
"Column 3": "3",
"Column 4": "4"
},
{
"Column 1": "2",
"Column 2": "3",
"Column 3": "4",
"Column 4": "5"
},
{
"Column 1": "3",
"Column 2": "4",
"Column 3": "5",
"Column 4": "6"
},
{
"Column 1": "4",
"Column 2": "5",
"Column 3": "6",
"Column 4": "7"
},
{
"Column 1": "5",
"Column 2": "6",
"Column 3": "7",
"Column 4": "8"
},
{
"Column 1": "6",
"Column 2": "7",
"Column 3": "8",
"Column 4": "9"
},
{
"Column 1": "7",
"Column 2": "8",
"Column 3": "9",
"Column 4": "10"
},
{
"Column 1": "8",
"Column 2": "9",
"Column 3": "10",
"Column 4": "11"
},
{
"Column 1": "9",
"Column 2": "10",
"Column 3": "11",
"Column 4": "12"
},
{
"Column 1": "10",
"Column 2": "11",
"Column 3": "12",
"Column 4": "13"
}
]
Resources.Designer.vb
��' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
' <