Quantcast
Channel: PTC Community : Discussion List - PTC Mathcad
Viewing all articles
Browse latest Browse all 2936

Referencing Worksheet of Embedded Excel Component in Mathcad

$
0
0

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!


Viewing all articles
Browse latest Browse all 2936

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>