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

Using CWD variable to reference worksheet

SOLVED
DaniBoy
Participant

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.

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Using CWD variable to reference worksheet

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

View solution in original post

6 REPLIES 6

Re: Using CWD variable to reference worksheet

Hi,

Use

 

concat(CWD,"Reference.mcdx")

 

Cheers

Terry

 

Re: Using CWD variable to reference worksheet

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

 

Re: Using CWD variable to reference worksheet

FredKohlhepp_0-1575897835832.png

 

Re: Using CWD variable to reference worksheet

Thanks for clarification, Fred. What I'm trying to do however is to  use the CWD variable in order to include another worksheet file. This would imply that I could, in some way or another, use this string variable (file) as a path to the referenced file. Which is not going to work, as you can see:

 

CWD.JPG

 

 

Re: Using CWD variable to reference worksheet

This method would work for readfile commands, the ones that read in data.  I think you're trying to include mathcad calculation files--the ones that are basically "copied" into the open file.  And you're right, that has never worked.

Re: Using CWD variable to reference worksheet

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

View solution in original post

Announcements
Check out the latest
Mathcad Tip
"PTC Mathcad 15 / Prime 1-6 Update."