Click to See Complete Forum and Search --> : OLE container control


kmenezes
August 28th, 2001, 04:26 PM
Trying to resize an excel object in an OLE container control. I can't seem to do it. When I embed a workbook in the control, it only fills up part of the control, not the whole thing. So, I would like to resize it, but none of the SizeMode constants seem to work.

Anyone run into this problem before?

bhanuprakash
August 29th, 2001, 04:55 AM
you can resize the object as per the size of the ole control to do that you have to set the sizemode property .
the code is *** follows
object.sizemode = value
and value can be either 0,1,2,3 and the explaination for all these modes is as follows

VbOLESizeClip 0 (Default) Clip. The object is displayed in actual size. If the object is larger than the OLE container control, its image is clipped by the control's borders.

VbOLESizeStretch 1 Stretch. The object's image is sized to fill the OLE container control. The image may not maintain the original proportions of the object.

VbOLESizeAutoSize 2 Autosize. The OLE container control is resized to display the entire object.

VbOLESizeZoom 3 Zoom. The object is resized to fill the OLE container control as much as possible while still maintaining the original proportions of the object.

bhanuprakash
August 29th, 2001, 05:00 AM
i have tries it out writting a sample code it works kindly put in this code in the form load event and see

ole1.sizemode=1

kmenezes
August 29th, 2001, 11:57 AM
Thanks for your advice Bhanuprakash. I tried the sizemode=1 in the form_load, but it doesn't work. The spreadsheet does not fill the OLE container control like that setting says it should.

Have you used OLE container controls a lot?