I have an Access database for my music collection. A certain button, when focused on a single MP3 file, tries to open the file from it’s file location in mp3tag. I always get the popup message “File cannot be accessed.” But then when I click the OK button, mp3tag opens up with the file as expected. I’m living with this, but it’s a nuisance.
Here is the VBA command to open the file (Quote is a custom routine to put quotes around a string):
According to the documentation, a single file should be called this way:
Start with file
Mp3tag.exe /fn:"<full-qualified file name>"
Please double check if your Quote custome routine really adds the quotation marks (aka double quotes) around the full-qualified file name as shown in the documentation.
I can not test it, but in VBA it should look like this: Shell """C:\Program Files\Mp3tag\Mp3tag.exe"" /fn:""F:\Android3\Indie\1980s\Indie 1984\U2 ~ Bad.mp3""", vbMaximizedFocus
The Quote function you see in the VBA code handles this; I wrote it to avoid dealing with setting up quotes properly when I’m constructing strings command fragments. The second snippet of code shows the actual resulting shell command.
When building the exec command in the code, you need the extra quotes, pairs of which then cancel out to single double-quotes, which is then passed to the shell command. The first code snippet is my actual VBA code; in it there is a Quote function which handles all the double double-quotes needed which pair down to the single double-quotes passed along to shell, which I show in the second code snipped.
For shits and giggles, I stepped through my code in debug mode, and then manually edited the resulting shell command after adding in all the double or triple double-quotes. I got the same results. And again, the command does work, but only after first getting “File cannot be accessed” message from mp3tag. So it seems to be an issue with how I’m using mp3tag’s command line, as if I’m missing an option.
In re-examining the syntax, I realized I had a space between the /fn: option and the filename. I took this out and the problem went away. Not sure why it worked as expected after getting the “File cannot be accessed” message, but I don’t get it anymore after removing the space.