Creating Shapes from excel file

Started by delaluz4, January 07, 2010, 06:23:16 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

delaluz4

Does anybody know how to create a shape using an excel file and then importing it into Visio to create a shape? I want the values in the excel file to correspond to a position in Visio Coordinate System. I know I could use the Size & Position window to move a shape to a specific location but I don't want to manually.

Thanks,

Lenny

aledlund

perhaps you could share your definition of "create a shape"?
al

delaluz4

Hi Al,

By "creating a shape" I mean by creating a circle or triangle shape. I'm not looking for a specific shape, but maybe a circle would help.
I think there has to be a way to create a shape from an excel file and somehow link it into Visio.

aledlund

Well for the simple stuff, Chris (I believe) has an example of creating a flowchart from an excel sheet. That should get you started. I believe there is also an example of using the same sheet to place a shape explicitly at a point on the drawings.
Al

delaluz4

I tried creating a flowchart from an excel sheet but it didn't work. I did some more research and what I need is to define a shape in the coordinate system. For example, you know about the shapesheet feature right? You can change the geometry of the shape and location on the visio page using the shapesheet feature. I want to create a file similar to that on excel. That way I can change the location of the shape. Thats what I'm trying to do, but I can't figure out the correct format to import it into visio.

Lenny


aledlund

You're in the right place to learn what you need. There is no standard mechanism in Visio to do what you want. You will have to write the necessary code to read in your formatted excel worksheet and then apply the fields to the correct shapesheet cells to accomplish what you want. There are lots of examples in the visio sdk to assist you in learning how to work with the shapesheet.
al

scott

If you'd like another sample, see the attached. Run the Visio macro and then point the resulting file open dialog to the Excel file.

This was the first part of a quick project from a couple of years ago. The goal was to create pairs of "header" boxes linked to "data" boxes. The codes reads the Excel column headings to create both boxes and connect them. It also inserts the text from the Excel column headings into the header boxes. It also sets appropriate shapesheet cells so the text boxes are sized to fit the inserted text.

Al is right that there are lots of other examples around. Hope this helps...

Scott