Excel doc-level automation: dataBinding a range??

R

r.goncalvs

Is it possible to use a range as a DataSource for databinding in an
actionspane? As far as i've read, a DataSource should be an object, so
i imagine i should create a class for my range object. Is that right?
Can i extend the namedRange class in order to perform this?

Actually, maybe i've got the whole idea wrong. What i actually want to
do, is to create an actionspane with some methods that react depending
on the data available on the namedRange. Eg.: i've got a cell which
receives climate data, and the idea is to trigger some methods
according to the wheather conditions.

I hope this confusing explanation was clear enough to paint a general
idea of what i want to do and the troubles i am into right now.

many thanks.
 
C

Cindy M.

Hi R.goncalvs,

I think the better place to ask this would be the VSTO forum

http://social.msdn.microsoft.com/Forums/en-US/vsto/threads/?
prof=required&page=1

When you post, be sure to mention the version of VSTO and of Excel
you're targeting.

FWIW, as far as I know there's no direct way to link an ActionsPane or a
DataSource with an Excel range (or a VSTO NamedRange). You'd need to
monitor events in Excel. Perhaps a SheetCalculate event?
Is it possible to use a range as a DataSource for databinding in an
actionspane? As far as i've read, a DataSource should be an object, so
i imagine i should create a class for my range object. Is that right?
Can i extend the namedRange class in order to perform this?

Actually, maybe i've got the whole idea wrong. What i actually want to
do, is to create an actionspane with some methods that react depending
on the data available on the namedRange. Eg.: i've got a cell which
receives climate data, and the idea is to trigger some methods
according to the wheather conditions.

I hope this confusing explanation was clear enough to paint a general
idea of what i want to do and the troubles i am into right now.


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 
R

r.goncalvs

Thank you Cindy for your reply. I'll try posting in the VSTO forum as
well.

I am developping against Excel 2007 and VS2008. The problem i find
using excel events to monitor changes is that they do not always
respond as expected. Cells being updated by other means than direct
editing (such as dynamic links or COM components) do not respond to
Change events, and this is just enough for me to avoid this model,
since it won't work in my project. Excel events are really something
that should never be relied on.

And i am coming to the same conclusion that excel range object (or
VSTO range) cannot be binded to data.

Thanks anyway.
 
C

Cindy M.

Hi R.goncalvs,
And i am coming to the same conclusion that excel range object (or
VSTO range) cannot be binded to data.

Now, that's another thing entirely. You CAN link a ADO.NET data
source to a NamedRange object (one data element) or to a ListObject
(mutiple fields/items).

What doesn't work is to link the Excel object directly to a control
in an ActionsPane.
Cells being updated by other means than direct
editing (such as dynamic links or COM components) do not respond to
Change events

Ah, but don't you have control over these? Then you should be able to
structure that code to fire a custom event that will also trigger
performing the necessary tasks?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail :)
 
R

r.goncalvs

Now, that's another thing entirely. You CAN link a ADO.NET data
source to a NamedRange object (one data element) or to a ListObject
(mutiple fields/items).

What doesn't work is to link the Excel object directly to a control
in an ActionsPane.

Sure, i just didn't express myself properly.
Ah, but don't you have control over these? Then you should be able to
structure that code to fire a custom event that will also trigger
performing the necessary tasks?

No, i don't have control over the components. The custom event you
mean would be related to the source data, not my client app, right?

thanks again
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top