ActiveX
To size columns in bound sheets
- Follow the steps listed for Connecting to a Database Using Default Settings to bind the sheet to a database.
-
To have the columns automatically sized based on the data in the database fields, set the DAutoSizeCols property to either of the following values:
- 1 (Max Col Width) to size the column to the length of the longest string in the field
-
2 (Best Guess) to size the column to the length of the database field (the default setting)
Note: If the bound cells are edit cells, be aware that the default setting of the TypeMaxEditLen property is 60 characters. You must reset the TypeMaxEditLen property to 255 characters to accommodate a text field in the bound database.
- If you do not want the columns automatically sized based on the data in the database fields, in the DataColConfig event, set the DAutoSizeCols property to 0 (Off) and if you want, size the columns manually.
- At run time, specify the column width with the ColWidth property or use one of the other techniques available for sizing columns, as described in Setting the Width of Columns.