Read range

A component for getting data from a Google Sheets cell range.

PropertyTypeDescription

Range

String

Cell reading range (A1:D12). If nothing is specified, current selection will be used as the range.

Sheet name

String

Sheet name

Variable (text)

List<List<string>>

Variable that stores reading results with text values

Variable (info)

Variable that stores reading results with cell info

Variable (table)

System.Data.DataTable

Variable that stores reading results

Headers row

bool

First row contains headers (for a table)

ExcelCellInfo

LTools.Office.Model.ExcelCellInfo

PropertyTypeDescription

Value

Cell value

TextValue

String

Cell text value

BackroundColor

Cell background color

FontColor

System.Drawing.Color

Cell font color

BorderType

LTools.Office.Model.ExcelBorderTypes?

Cell border type

CustomBorderType

LTools.Office.Model.ExcelCustomBorderTypes[]

Cell border type for ExcelBorderTypes.Custom

Height

Row height (determined by the first cell)

Symbol ? in the data type means that the value can be null.

LTools.Office.GoogleSheetsApp app = LTools.Office.GoogleSheetsApp.Init(wf, @"Token file path", @"Spreadsheet ID");
//String array
List<List<string>> data = app.ReadRange("A1:B1", "Sheet1");
//Cell info array
List<List<LTools.Office.Model.ExcelCellInfo>> data2 = app.ReadRangeInfo("A1:B1", "Sheet1");
//Table
System.Data.DataTable data3 = app.ReadRangeTable("A1:B1", "Sheet1");

Last updated