FYI - a couple of tips when working with COM and C#:
1. If at all possible try to ensure the program is visible. Automating a program is much easier if you can see it.
2. Break it up into smaller steps.
3. var is useful (I'm a convert anyway), especially when dealing with COM or for loops. I think var came in with C# 3.0
4. If you hit a roadblock, and if possible, do it in VB - then try to replicate in C#. VB is the language of COM and makes it nice and easy to see what is going on.
5. Check out the object tree (double click on Mathcad in your references area). Even if it doesn't show the class of the returned object, it will still give hints. Everything in com must be exposed as a known interface/class, which is why I knew to look for a "value" interface.
Good luck.
var mc = new Mathcad.Application();
mc.Visible = true;
var wks = mc.Worksheets;
var wk = wks.Open(@"e:\mcad.xmcd");
wk.SetValue("b", 20);
var b = (Mathcad.INumericValue)(wk.GetValue("b"));
lblResults.Text = (b.Integer).ToString();
Philip
___________________
Correct answers don't require correct spelling.