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

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Retrieving variable with greek letters using Mathcad API

ptc-1448098
1-Visitor

Retrieving variable with greek letters using Mathcad API

Hello,

I'm trying to command a Mathcad worksheet from Excel, using the Mathcad API interface.

I would have to access to some variables that use greek letters, but I'm having some problems. Following the help, I'm using the MC.GetValue() function to retrieve the variables from the mathcad worksheet (the MC is the object associated to the mathcad worksheet).

From the help: when variable has greek letters, they should be mapped using the backslash (in Visual Basic), so α is retrived with MC.GetValue("\a"). Whit this form, I can't get any value and I have an error message. The error message is:

Run-time error '-2147218257 (80040caf)

Impossible to find the required value in the worksheet

If the variable hasn't any greek letter, the method MC.GetValue() works perfectly, giving the corresponding values.

I'm using Mathcad 14.0 M020 (14.0.2.5).

Has someone encountered a similar problem? There are some hints to try to solve this problem?

I thank in advance for any help.

2 REPLIES 2
Werner_E
25-Diamond I
(To:ptc-1448098)

I am not sure, but I think that the use of \ as an escape was the method for MC versions prior of MC14. In MC14 and above you should be able to just use the Unicode of the greek letters.

BTW, just found in the release notes of MC15 a bugfix mentioned (fixed in MC15 F000) concerning SetValue and greek letters: "1406906 Fixes a problem in automation involving setting the value of Greek letters "

No further information given.

Thank you for the answer.

I think you are right. After posting my question, I found a similar discussion with object "Read greek symbol" where from MC14 it is necessary to use the Unicode representation.

In VB language, it was suggested to use the ChrW function as:

Worksheet.GetValue(ChrW(945)) <--> for alpha

But when I tried, I haven't had success. I will make new tests soon.

Anyway thank you to showing me the way.

Stefano

Announcements

Top Tags