OWC11 - Cannot set the DataSource property to be = Axspreadsheet1

P

Phil

Hi,

I have a Chartspace that I would like to bound to an
AxSpreadSheet control.

The following VB.Net code generates a "Specified cast not
valid" error message at run time (both AxChatSpace1 &
AxSpreadsheet1 exist on my test Form):

AxChartSpace1.DataSource = AxSpreadsheet1

The examples I have seen in the many support sites I
visited seem to indicate that the syntax I'm using is
right, so were is the catch ???

many thanks in advance,
Phil
 
P

Phil

To respond to my own question, in case this helps
someone, the solution (found in MSDN's Visual Basic.Net
Knowledge Base) is that the statement:

AxChartSpace1.DataSource = AxSpreadSheet1

should be replaced by:

AxChartSpace1.DataSource = AxSpreadSheet1.GetOcx()

It works.

Phil
 
Top