1

I am succesfully binding XSD to Excel using Interop (C#) and XPath.

However, there is one thing I am unable to succeed at.

When using the Developer toolbar in Excel it is possible to bind an entire XSD to a cell. This creates some sort of merged row in the Excel sheet for all the attributes in the node. When expanding this row one can receive multiple values for each attribute from XML.

I would like to have this behaviour as well in the code I wrote, but so far I have only been able to map attributes sepperatly to a single cell.

So the question is: Can I bind an entire Node to a cell using interop? Instead of binding the attributes sepperatly.

Thanks!

Edit:

This is a screenshot of what I have now:

http://imageshack.us/photo/my-images/193/badl.png/

And this is a screenshot of what I want (Manually done in Excel):

http://imageshack.us/photo/my-images/406/goodu.png/

2 Answers 2

1

I'm unsure on your particular case, but if you're using Excel interop then you can use a little trick.

Create a new macro (in Excel 2007 its View->Macro).

Perform the manual action.

Stop the macro.

Then Step-into the macro and see what the VBA code looks like, will give you a starting point on how to do it with Interop.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for your reply. Unfortunatly, this particulair action does not get recorded by the macro recorder. I had already tried that ;)
0

It seems that I have figured out what to do.

I was creating a List object for each cell and then binding it using xpath.

What I had to do was span the List object over multiple columns (using a range object), and then bind each cell in the list using xpath.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.