Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Modifying VBA Shapesheet Not Updating Shape

Status
Not open for further replies.

TheInsider

Programmer
Jul 17, 2000
796
CA
Hi,

I'm attempting to change the foreground fill-color of various shapes via VBA code, as follows:

Visio.ActivePage.Shapes("Sheet.61").Cells("FillForegnd").Formula = "RGB(255,0,0)"

This works with some shapes but not with others. The funny thing is, after the code executes, the Shapesheet reflects the new value, and if I right-click the shape and select Format->Fill..., the dialog box will display the correct (new) fill color. However, the shape, itself, never changes color!

Has anyone seen this phenomenon before? Is it a bug in Visio, or am I supposed to refresh the drawing somehow? I tried saving the drawing and then closing & reopening, but the color doesn't change.

TIA
 
Bah! I figured it out. Apparently some sheets are composed of more than one shape, so you have to do a For Each through the .Shapes collection to set each sub-shape's color individually.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top