//create a new workbook var workbook = new GrapeCity.Documents.Excel.Workbook(); //ToJson&FromJson can be used in combination with spread.sheets product:http://spread.grapecity.com/spreadjs/sheets/ //GrapeCity Documents for Excel import an excel file. //change the path to real source file path. string source = System.IO.Path.Combine(this.CurrentDirectory, "source.xlsx"); workbook.Open(source); //GrapeCity Documents for Excel export to a json string. var jsonstr = workbook.ToJson(); //use the json string to initialize spread.sheets product. //spread.sheets will show the excel file contents. //spread.sheets product export a json string. //GrapeCity Documents for Excel use the json string to initialize. workbook.FromJson(jsonstr); //GrapeCity Documents for Excel export workbook to an excel file. //change the path to real export file path. string export = System.IO.Path.Combine(this.CurrentDirectory, "export.xlsx"); workbook.Save(export);
' Create a new Workbook Dim workbook As New Workbook 'ToJson&FromJson can be used in combination with spread.sheets product:http://spread.grapecity.com/spreadjs/sheets/ 'GrapeCity Documents for Excel import an excel file. 'change the path to real source file path. Dim source As String = IO.Path.Combine(CurrentDirectory, "source.xlsx") workbook.Open(source) 'GrapeCity Documents for Excel export to a json string. Dim jsonstr = workbook.ToJson() 'use the json string to initialize spread.sheets product. 'spread.sheets will show the excel file contents. 'spread.sheets product export a json string. 'GrapeCity Documents for Excel use the json string to initialize. workbook.FromJson(jsonstr) 'GrapeCity Documents for Excel export workbook to an excel file. 'change the path to real export file path. Dim export As String = IO.Path.Combine(CurrentDirectory, "export.xlsx") workbook.Save(export)