Hi all,

I have a very simple function showing the duration of external audio files:

Function WaveLength(sPathWaves As Variant, sFilename As Variant)
    Set objShell = CreateObject("Shell.Application")
    Set objFolder = objShell.Namespace(sPathWaves)
    Set objFolderItem = objFolder.ParseName(sFilename)
    
    WaveLength = objFolder.GetDetailsOf(objFolderItem, 27)
End Function
I can call the function like this:
=Personal.xlsb!wavelength("D:\Temp";A1)
where D:\Temp is the path and A1 refers to a cell containing the file name.

This works too.

However when I replace "D:\Temp" with prefix (the name of a cell containing the same text), things go wrong and I get #VALUE! instead. I think this has to do with the \, but I'm not sure.

I'd like to be able to call the function like:

=Personal.xlsb!wavelength(prefix;A1)
Any suggestions?