cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Referencing Worksheet of Embedded Excel Component in Mathcad

ddumapit
2-Explorer

Referencing Worksheet of Embedded Excel Component in Mathcad

Hi!

I am using Mathcad 15 and Excel 2013.

I need help regarding this. This problem is only illustrative of the one I want to solve.

Suppose that I have a Mathcad file wherein I am embedding an Excel Component. (See attachment).

Say if the value of Cell A1 is not "Happy", Picture 1 will be hidden. It will be shown otherwise.

Normally, it would be easy to do this in Excel. The code would be:

Private Sub Worksheet_Change(ByVal Target As Range)

If Cells(1, 1).Value = "Happy" Then

    ActiveSheet.Pictures("Picture 1").Visible = True

Else

    ActiveSheet.Pictures("Picture 1").Visible = False

End If

End Sub

Now, I am trying to make this code run inside the Mathcad embedded excel file by coding it there. However, I am confronted with the error:

2016-02-24_8-15-38.png

I am thinking that maybe I cannot refer to the embedded sheet as simply "Activesheet."

Can anyone help me sort this out?

Thank you very much!

1 REPLY 1
StuartBruff
23-Emerald III
(To:ddumapit)

Try Shapes("Picture 1").Visible = True/False instead (note no dot preceding 'Shapes').

Stuart

Announcements

Top Tags