
Excel Workbook vs. Worksheet
Quote:
>Good tip Mike, but I have another problem. I use an OLE OBJECT instead of
>creating X. This is basically so I can see the sheet as I change values and
>attributes. However, if I use the Open command I still get the blank workbook
>and sheet. How do I set the visible object to be myworbook/worksheet? Do I
>need to imbed an actual Excel object and not use the generic OLE OBJECT? Or
>do I need to DIM X and somehow set the OLE object to X? This is really
>bugging me.
> -brian davis
The way I have done this is to create an excel object which I can manipulate
and change, and also have the workbook linked to an OLE object. AFAIK there is
no way to set the OLE object to the excel object. This is how I have done it:
Public xl As Excel.Application
Public xlb As Excel.Workbook
Set xl = CreateObject("Excel.Application")
Set xlb = xl.Workbooks.Open("C:\Blah\Blah.xls")
OLE1.SourceDoc = "C:\Blah\Blah.xls"
OLE1.SourceItem = "Sheet1"
OLE1.Action = 1
To give me more control over when the updates to the workbook are shown I also
set the Ole containers UpdateOptions property to Manual. Then the only time it
is updated is when I issue the 'OLE1.Update' command.
I hope this helps, let me know if you need more help.
Mike Thompson
BHP NZ Steel Ltd
Auckland
New Zealand