Search code examples
excelvbavlc

VLC playlist parameters with spaces


on my excel sheet the user can choose some video clips and arrange in different order to play as a vlc playlist. Unfortunately it can’t be guaranteed that the video file names haven’t any blanks. To build the vlc playlist I use successfully:

Dim PL 
PL = Shell("C:\Program Files\VideoLAN\VLC\VLC.exe " & certainPath & "\Movie6.flv" & " " & certainPath & "\Movie7.flv" & " " & certainPath & "\Movie8.flv ", 1)
'using "\Movie 6.flv" 'doesn't work of course
'using "\'Movie 6.flv'" 'doesn't work aswell

Is there another way to encapsulate file name with blanks? thankfull for a hint.


Solution

  • Assuming that certainPath folder end with \ ( es. "C:\" ), this should work:

    Dim PL
    PL = Shell(chr(34) & "c:\Program Files\VideoLAN\VLC\vlc.exe " & chr(34) & chr(34) & certainPath & "Movie 6.flv" & chr(34) & " " & chr(34) & certainPath & "Movie 7.flv" & chr(34))
    

    CHR is a function to returns the character from the ASCII table (the quotes in this case).