0

I'm trying to change the formula within a shape without selecting it but keep getting a run-time error.

Below are some of the code I've tried so far:

    Sheets("Quote").Shapes.Range(Array("Rectangle 87")).Formula = " =CommAnnualOutput"
    Sheets("Quote").Shapes("Rectangle 87").Formula = " =CommAnnualOutput"
    Sheets("Quote").Shapes("Rectangle 87").DrawingObjects.Formula = " =CommAnnualOutput"

None of these seem to work. Is there a way to change the formula without selecting the shape first?

Community
  • 1
  • 1
evoandy
  • 630
  • 4
  • 16
  • 31

2 Answers2

2

Please find the answer to your question here:

Link cell with Excel Shape

Good luck

Community
  • 1
  • 1
K_B
  • 3,668
  • 1
  • 19
  • 29
  • I had seen this question but it didn't seem to work. It turns out it was because I'd left a space between before the second equals sign which was giving a run-time error. Thanks for your help! – evoandy Nov 01 '12 at 15:56
0

You missed two characters on your last try. That would be

Sheets("Quote").Shapes("Rectangle 87").DrawingObject.Formula = "=CommAnnualOutput"
panda-34
  • 4,089
  • 20
  • 25