Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datagrid size in Excel acting flakey

Status
Not open for further replies.

WillyKelleher

Programmer
Feb 19, 2002
36
US
I placed a datagrid control on an excel sheet and set the width and then through vba I load a recordset into it.

I am having problems with it, after I close and reopen the workbook the grid loads in the sheet activate code but only the top left inch or so is selectable and the rest apears but not realy. It is almost like the grid has resized itself but left behind the orginal screen with the grid contents

If I delete the grid and add it back then move off sheet and back on the grid is perfect.
or if I keep making the grid just a little bigger in the vba worksheet activate function I can get the grid back under controll

Also to keep the grids size I have to resize it after
loading the recordset or it will size down to that inch mentioned above. I have tried everything.

Private Sub Worksheet_Activate()
LoadDg
End Sub

Public Function LoadDg()
'Set Me.DataGrid1.DataSource = Nothing
Set Me.DataGrid1.DataSource = rsSpeed
Me.DataGrid1.width = 602
'Me.DataGrid1.Refresh
Me.DataGrid1.width = 600
Me.DataGrid1.Refresh
end function

Any help would be apreciated
Thanks
 
Hi,

I have zip experience with datagrids on a sheet, but I do have experience with OTHER control objects on sheets.

Try to set the object format -- select the object -- menu item Format/Control/Properties - and make sure that no change size option is selected.

Dunno it that'l help :cool:

Skip,
Skip@TheOfficeExperts.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top