Quantcast
Channel: PTC Community : All Content - Programming & Extending Mathcad
Viewing all articles
Browse latest Browse all 680

Application.ActiveWorksheet returns nothing

$
0
0

I am embedding some VB in a Scripted Object within a MathCad worksheet. I am trying to get the Worksheet object so I can get/manipulate some values in the sheet, but when I call ActiveWorksheet (or Worksheets for that matter) on the Application object, nothing is returned.

 

I am inexperienced with VB so forgive anything weird I am doing, but feel free to point it out. Here is what I have basically. I get an error object worksheet is required on the last line of the Sub.

 

Sub getValueEvent_Exec(Inputs,Outputs)

  Dim objMC

  Dim value

  Dim worksheet

  

  Set objMC = CreateObject("MathCad.Application")

  Set worksheet =objMC.ActiveWorksheet

  Set value = worksheet.getValue("value")

 

End Sub

 

Thanks,

Evan


Viewing all articles
Browse latest Browse all 680

Latest Images

Trending Articles



Latest Images

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