Re: Cannot Embed excel file with OLE (vb6)

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Denis,

You can place a PictureBox on your Form, add Scrollbars to it and then
put your OLE Control inside the PictureBox. Make sure the size of the
OLE is large enough. Do required positioning in Scrollbars event
handlers and you get the whole contents of your spread*** displayed.

Hope this helps,

Max Kudrenko
Brainbench MVP Program for Visual Basic
www.brainbench.com


potvin@xxxxxxx wrote:
> Hi,
>
> I am trying to read an excel file (one *** only) with about 70 lines
> and 6 columns of data using OLE. My problem is that I cannot read all
> the 70 lines, it stops reading around the line 50 or so. Is anybody
> have a clue? Is there missing something in my code? I thought the file
> could be corrupt, but I made a new one and I got the same result.
> Here is my code
> With OLE1
> .Delete
> .Class = "Excel.Sheet8"
> .CreateEmbed "C:\MyFile.xls"
> .SizeMode = 0
> .Update
> End With
> I am using VB6 (SP6) and excel 2000.
> Thanks
> Denis

.


Quantcast