ComponentOne VSFlexGrid 8.0
LoadGrid Method

Loads grid contents and format from a file.

Syntax

[form!]VSFlexGrid.LoadGrid FileName As String, LoadWhat As SaveLoadSettings, [ Options As Variant ]

Remarks

This method loads grid from a file previously saved with the SaveGrid method, comma-delimited text file (CSV format) such as an Excel text file, or a tab-delimited text file.

The parameters for the LoadGrid method are described below:

FileName As String

The name of the file to load, including the path. This file must have been created by the SaveGrid method, or an Invalid File Format error will occur (error #321).

LoadWhat As SaveLoadSettings

This parameter specifies what should be loaded. Valid options are:

 

Constant

Value

Description

flexFileAll

0

Load all data and formatting information available in the file.

flexFileData

1

Load only the data, ignoring formatting information.

flexFileFormat

2

Load only the formatting, ignoring the data.

flexFileCommaText

3

Load data from a comma-delimited text file.

flexFileTabText

4

Load data from a tab-delimited text file.

flexFileCustomText

5

Load data from a text file using the delimiters specified by the ClipSeparators property.

flexFileExcel

6

Load a sheet from an Excel97 file (you can specify which sheet to load using the Options parameter). This filter does not support frozen color rows or columns.

 

Options As Variant (optional)

When saving and loading text files, this parameter allows you to specify whether fixed cells are saved and restored. The default is False, which means fixed cells are not saved or restored.

When saving and loading Excel files, this parameter allows you to specify the name or index of the sheet to be loaded, or the name of the sheet to be saved. If omitted, the first sheet is loaded.

Notes

The flexFileExcel option is new in Version 8. It does not require Excel to be present on the machine. You can load and save Excel97 sheets (BIFF9 format), one sheet per workbook only (when loading, you can specify which sheet using the Options parameter).

The Excel filter supports cell values (including formula values), fonts, formats, colors, row and column dimensions. It does not support features that don't translate into the grid, such as macros, charts, rotated text, cell borders, and other advanced formatting.

Starting in build 200, the control also recognizes a string parameter when saving/loading text files. If the string contains an 'f', fixed cells will be included when saving/loading. If the string contains a 'v', only visible cells will be saved to the text files. For example:

fg.Save("c:\export\)

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback