0

I have a package that gets loaded in many notebooks I use, with

Import[pathToLibraryDirectory<> "toolkit.m"];

This toolkit in turn loads some Excel spreadsheets that contain reference data. I prefer to keep this data external for reasons of supportability and ease in updating as new reference data is released.

The excel files live in a directory at the same level in the file structure as the directory that contains the toolkit.

The toolkit contains therefore

sheetICareAbout=Import[NotebookDirectory[]<> "..\\reference tables\\excel data notebook.xls"][[2]];

and this works if I open the toolkit and execute this line by hand, but it doesn't work if I save the toolkit as a package and load it that way. The NotebookDirectory call no longer points to the right thing. I can put in an absolute path to the directory that works in some cases, but I load this toolkit from different machines and operating systems, and the absolute paths don't always look the same.

Hence my question, is there some relative path I can refer to so that the package can find the excel files?

Michael Stern
  • 4,695
  • 1
  • 21
  • 37

0 Answers0