Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was able to IMPORT from excel data at the start of my project when both the .nb and EXCEL XLS files were sitting in MyDocument (or some other location), but upon moving both files into my Dropbox location, when I opened my .nb file again, IMPORT fails with 'File not found during Import'? I assume having both in the same directory is not suffice, but rather IMPORT only looks for file as defined by path setting within Mathematica? If so how to change it so that regardless of where I put the .nb and excel files, as long as they are both in the same directory I can do IMPORT?

share|improve this question
look up ref/$Path – Mike Honeychurch Dec 12 '12 at 23:56
AppendTo[$Path, NotebookDirectory[]] – Rolf Mertig Dec 13 '12 at 0:13
HI @Rolf it works! and so use if I again move the .nb and excel file again to a CD /DVD disk, then this command at the first line will also do the same and append path I assume. – sebastian c. Dec 13 '12 at 0:19

If the file you wish to import will always be kept in the same directory as your Mathematica notebook you may do:

Import[NotebookDirectory[] <> "filename"]


Import[FileNameJoin[{NotebookDirectory[], "filename"}]]
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.