is this possible?

M

mike

I'm creating shapes with various numbers of rows of data from an Excel
spreadsheet, which is displayed in the shape's text. A shape may contain more
than one row. I would like to keep some of the "metadata" (non-text cells;
e.g. textID number) for each row in the shape, but not visible to the viewer,
so that in the future I can compare the text in the shape with the orginal
text in the Excel spreadsheet, to see if any changes have been made.

Hope this is clear enough.

Any ideas how this might be done?

Thanks!
 
J

Jonathan Spane

The shape has custom properties or a user data section that should be what
you need. You access these parts of shapes via CellSrc method. You can put
text, numbers, formulas in these cells and they can have unique values per
instanced shape if need be. Hope this helps.
 
M

mike

I've looked at custom properties, but I didn't see a way where I could define
a custom property on a specific line of text in a shape.
What I'd like is a way to address each line in a shape, like:
<line 1> Hello.
<line 2> This is Mike.
The "<line 1>" is a cell (column A) from the same row of an Excel
spreadsheet, that I want to be assciated to "Hello" (column B), but not
visible to the user, so that I can later compare the text of <line 1> in the
Visio shape to <line 1> in the original spreadsheet. The same thing would be
applicable to "<line 2>" and "This is Mike."
Does that make sense?
 
A

Al Edlund

If you're using v2007 datarecordsets for the data source (being fed by the
excel document), yes the data between the custom properties and the shapes
can be compared. It is not standard, custom code has to be written
al
 
J

Jonathan Spane

Here is what I would do but I am sure there are other ways.

1. Anything you put in that text box will be displayed. You are going to
need a delimeter from one line of text to the next. It could be the newline
character.
2. For easier reference I will refer to <line 1> as the "key". The text will
be the "value" So now you have these key, value pairs.
3. You want to display values but not the keys. For this work your keys
cannot have spaces or special characters. Just letters, numbers and
underscores.
4. If you have many key, value pairs the text box is going out if the shape
but I wll come back to that.
5. I would make a new entry in the user section for each key. I have to
assume keys are unique for this to work.
6. The user section row would based on the key name.
7. The value in the row would be the line of text. So the text is in two
spots. The visible textbox and in the user section.
8. To do a check you would loop through the rows of the user section and for
each row. Parse your Key and Value back out and compare with excel. If they
are different you need to update, delete the row.
9. As you begin updating each row accordingly I would be build up the lines
of text (values) so after you done merging you just write the new lines of
text to the shape replacing what is there regardless of a change or not.
10. Like I said if you have many key, value pairs then you could display the
information in custom properties. Each property row would be named based on
the key and the value is what is displayed. One value per property. The user
to view this data has to right click on the shape and select View->Custom
Properties Window. You can even have hidden custom properties if need be (I
use that trick).

You have to work with Visio on this.
 
M

mike

We are using v2003.

Al Edlund said:
If you're using v2007 datarecordsets for the data source (being fed by the
excel document), yes the data between the custom properties and the shapes
can be compared. It is not standard, custom code has to be written
al
 
M

mike

Thank you very much. I will do some experimenting with your solution and see
how it works out.
 

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