View Single Post
  #1 (permalink)  
Old March 9th, 2004, 12:50 PM
selbybrock selbybrock is offline
Authorized User
 
Join Date: Oct 2003
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Default file locations

Way back on 24 October, I posted a query: my program would play .WAV files if I loaded it with the Open File dialogue, but not if I opened it via the Taskpane. I got no replies.
I have now cracked the problem: it might be of general interest.
The original program was in a sub-directory of My Documents, as were the .WAV files I wanted to play.
The default file location in Excel is My Documents; however, when you navigate to a file with the Open File dialogue, this changes to wherever you end up. When the program calls for a .WAV file, it finds it.
However, if you start the workbook from the Taskpane, the default file location isn't changed: so the program was looking for the .WAV files in My Documents. Because it was an API call, there was no File Not Found error message; just silence.
You would get the same problem if your VBA program called an old-fashioned text file: in fact it was doing just this (with Word not Excel) that enlightened me.
I think this must qualify as a bug in Excel.