Skip to main content
1-Visitor
Solved

Using CWD variable to reference worksheet

Hi,

 

Is it possible to use the CWD variable to reference worksheets? Meaning instead of clicking on the 'Include <<' button and choosing the referenced worksheet file, to write something like: "CWD\Reference.mcdx" in the field next to the Include << button. I'm using Mathcad Prime 6.0.

 

Thanks in advance.

 

LucMeekesAnswer
23-Emerald V

If all you're trying to do is to include a (reference) worksheet in the same directory as where the (referencing) Mathcad worksheet itself is saved/located, then you can reference a reference worksheet named 'reference.mcdx' by '.\reference.mcdx'.

In (real) Mathcad, when specifying a reference worksheet you can tick an option to use a relative path, which has the same effect. I don't know if Prime has that option, I'm limited to Express.

Of course, if you are changing the CWD variable within your sheet, the above is not an option for you.

 

Success!
Luc

6 replies

terryhendicott
21-Topaz II

Hi,

Use

 

concat(CWD,"Reference.mcdx")

 

Cheers

Terry

 

Translate
DaniBoy1-VisitorAuthor
1-Visitor

Nice try. Unfortuantely it looks like the include reference function does not accept ascii string. Also I found this other thread, saying that there is no solution for this issue:

https://community.ptc.com/t5/PTC-Mathcad/Insert-gt-Reference-using-a-Variable/m-p/353759

 

Translate
23-Emerald I

FredKohlhepp_0-1575897835832.png

 

Translate
LucMeekes23-Emerald VAnswer
23-Emerald V

If all you're trying to do is to include a (reference) worksheet in the same directory as where the (referencing) Mathcad worksheet itself is saved/located, then you can reference a reference worksheet named 'reference.mcdx' by '.\reference.mcdx'.

In (real) Mathcad, when specifying a reference worksheet you can tick an option to use a relative path, which has the same effect. I don't know if Prime has that option, I'm limited to Express.

Of course, if you are changing the CWD variable within your sheet, the above is not an option for you.

 

Success!
Luc

Translate