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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Use relative path for referenced worksheets - Solved?

EH_10521406
3-Visitor

Use relative path for referenced worksheets - Solved?

Edit: Possibly solved? That was quick... See bottom.

 

How can I use a relative path when including reference worksheets?

 

The documentation suggests it is possible: "By default the include region displays the absolute path to the referenced worksheet. You can edit the path and make it relative."

 

I am collaborating with colleagues on a number of worksheets that include references to other worksheets. These are documents that 3 of us access and edit. We are currently using OneDrive, but the issue would remain even if all documents were emailed around. The "Include: path" changes, but all worksheets can exist in a single parent folder, or even a grandparent folder (which should work with a proper 'relative setup')

 

I have tried various ways like: ../  or ./ or / or //

https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats

 

I have found some ancient* threads discussing and confirming this ability as far back as 2004, but nothing new, or recent that suggests a way it can be done in Prime X.

 

Screen capture for reference.

Mathcad Prime 8.0

 

Thank you in advance!

 

Edit: Solution?

EH_10521406_0-1670519099851.png

It looks like if you remove everything except the file name it works. This suggests that there is a limitation on files in the same directory.

1 ACCEPTED SOLUTION

Accepted Solutions


I have tried various ways like: ../  or ./ or / or //

https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats

but you have not tried what you could read there -> you have to use backslashes, not forward slashes like in URLs!

So if a referenced worksheet "tables.mcdx" is located in a subdirectory "TESTDIR" of the directory of main sheet, you have to use ".\TESTDIR\tables.mcdx" (without the quotes, of course).

Werner_E_0-1670530887261.png

But you could as well simply use "TESTDIR\tables.mcdx" without explicitly referencing the current directory with ".\"

Werner_E_1-1670530966447.png

 

Many programs allow the use of forward slashes and convert them automatically into backslashes, but Prime does not. At least not when referencing/including worksheets - the various READ... functions like READBIN, etc. will allow the usage of forward slashes.

View solution in original post

2 REPLIES 2

Glad you could figure it out!

I manage the Creo and PTC Mathcad YouTube channels for PTC, as well as all PTC Mathcad marketing in general.


I have tried various ways like: ../  or ./ or / or //

https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats

but you have not tried what you could read there -> you have to use backslashes, not forward slashes like in URLs!

So if a referenced worksheet "tables.mcdx" is located in a subdirectory "TESTDIR" of the directory of main sheet, you have to use ".\TESTDIR\tables.mcdx" (without the quotes, of course).

Werner_E_0-1670530887261.png

But you could as well simply use "TESTDIR\tables.mcdx" without explicitly referencing the current directory with ".\"

Werner_E_1-1670530966447.png

 

Many programs allow the use of forward slashes and convert them automatically into backslashes, but Prime does not. At least not when referencing/including worksheets - the various READ... functions like READBIN, etc. will allow the usage of forward slashes.

Top Tags