PDA

View Full Version : Manipulating Shapes in VBA



cardona7
02-27-2010, 03:04 PM
Hi,

I'm new to the forms and relatively new to VBA. I'm a business student taking an engineering class with no prior programming experience. I just need some help getting this w/s to follow the rules of a game. The sheet is attached.

The rules are:

You start node1 and you can only click on node2 or node4, etc. You can only jump on a node that is attached to yours by arrows called Paths. If you going to ThisWorkbook in vba you'll see that their invisible.

I need code for when user clicks from currentNode to another legal Node, the invisible arrow inbetween becomes visible.

The problem is, since its invisible to begin with, an error comes up saying the shape is locked. How do i get to that unlocked shape?

also, how do I determine in code which moves are legal and which arent, IF statements?

lucas
02-27-2010, 03:06 PM
can you save it as an xls file and post that?

cardona7
02-27-2010, 05:04 PM
sure here it is

Bob Phillips
02-27-2010, 05:07 PM
I found all of the arrows grouped, and 1_2 was the name of the group. If I ungrouped them, added an arrow 1_2, it worked fine.

cardona7
02-27-2010, 06:12 PM
I don't understand. The Group of all the arrows is named Paths, the arrow pointing node1 to node2 is called 1_2. I need to leave them grouped, because the arrow's are set not to appear when the workbook opens.

I was hoping to find help being able to call an arrow to be visible individually depending on what node is selected?

SamT
02-27-2010, 07:34 PM
Here's a page of my Excel Object model for excel 97. See if it helps you with your homework.

See the cell comments for help text.

SamT
Edit: IIRC, You were using the construct "Sheets(3)." Use instead "Sheets(sheet3)."

Bob Phillips
02-28-2010, 04:40 AM
I don't understand. The Group of all the arrows is named Paths, the arrow pointing node1 to node2 is called 1_2. I need to leave them grouped, because the arrow's are set not to appear when the workbook opens.

I was hoping to find help being able to call an arrow to be visible individually depending on what node is selected?

Just set them all to non-visible on open, there are only a few.

cardona7
03-01-2010, 04:41 PM
Is it possible to set the group of arrows, "Paths" to visible = false....then recall the arroows individually based on which node path is taken??

attached is the finished sheet.......

I hid all the arrows individually then I'm able to recall them one by one.....


but the assignment calls for them to be grouped......

is it even possible???