Skip to main content
1-Visitor
December 8, 2022
Solved

Use relative path for referenced worksheets - Solved?

  • December 8, 2022
  • 2 replies
  • 2880 views

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.

Best answer by Werner_E

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.

2 replies

DJNewman
18-Opal
December 8, 2022

Glad you could figure it out!

PTC Marketer Creo and Mathcad. I run their YouTube channels, some Creo campaigns, and all Mathcad campaigns and communications.
Werner_E25-Diamond IAnswer
25-Diamond I
December 8, 2022

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.