p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Excel VBA (http://p2p.wrox.com/forumdisplay.php?f=79)
-   -   Default file locations (http://p2p.wrox.com/showthread.php?t=10296)

selbybrock March 9th, 2004 12:50 PM

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.




All times are GMT -4. The time now is 06:12 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.