Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.
I guess I don't understand. From your original post, it sounded like you were having trouble getting a certain range to appear in your OLE control's window. I can think of three reasons that would be happening:
1) The correct worksheet (tab) isn't showing.
2) The range isn't scrolled (either vertically or horizontally) to the correct position.
3) The RowHeight and/or ColumnWidth for the range it too large.
We solved #1 in the previous thread.
We solved #2 with the above mention of ScrollIntoView, ScrollColumn, ScrollRow, and VisibleRange.
And, to solve #3, you could take a look at the ColumnWidth and/or RowHeight properties of the Range object.
If one of these isn't the answer, then I guess I truly don't understand.
Also, truth be told, even though you're getting there through the OLE control, this is really a VBA discussion. The issues are precisely the same regardless of whether you're viewing Excel through an OLE control or just looking at Excel through an open copy of the Excel program. You can just think of the OLE control as an alternative place to open Excel (as opposed to the desktop window).
Good Luck,
Elroy
Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.
Thanks again for the reply and help I really do appreciate it
here is a pic of the ole container and what I am getting to display
I was a bit unsure where I'd would be looking for a solution (either in VBA or here in the VB6 world)
All I want is a full sheet displayed (gridlines and all other data)
Jeff
PS I started a new project - inserted OLE cont; then I went to the desired workbook - selected a sheet and then saved the workbook. Then went to the sourcedoc property and I get the desired display - all is good
Maybe I need to open the wb - select the desired sheet - then save - then in code re-specify the sourcedoc property..
Does this sound strange?
Last edited by habenero; Feb 6th, 2017 at 02:57 PM.
Reason: clarity - more info
Re: [RESOLVED] Ole container question - display problem
a follow up
It was what I suspected
In one form I start excel ; then build the reference to the workbook ; activate the worksheet and then save the workbook
Using a command button I reference the sourcedoc property in the OLE container (on another form) to null ; then use this magic line "ole_sheet_viewer.InsertObjDlg" to select the saved workbook and the container appears on the form with the sheet/workbook desired