Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using Shell to open files with more than one word in their name
play around with the single quote
Sub playfiles() Dim PlayFile PlayFile = Shell("'C:\Program Files\Winamp\winamp.exe C:\MP3\" & ActiveCell.Value & "'", 1) End Sub -- Regards, Tom Ogilvy "Phil1982" wrote: Thank you to colonal18 and Gary's Student, through combining your advice I'v managed to come up with this code which opens the file who's name is in the current cell and opens it with the application I want. Sub playfiles() Dim PlayFile PlayFile = Shell("C:\Program Files\Winamp\winamp.exe C:\MP3\" & ActiveCell.Value, 1) End Sub The only problem is it doesn't work on files with more than one word in their name. If the cell I have selected has a file with 2 words in its name e.g. Happy Birthday.mp3 - it opens WinAmp and treats it as if it was being asked to open 2 files(one called Happy, one called Birthday) neither of which exist. The obvious (and impractical) way around this is to manually rename every file with underscores_instead_of spaces. Does anyone know a better solution? Thanks Phil |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro - Open all word files in a directory | Excel Worksheet Functions | |||
Excel and Word will not open saved files | Excel Discussion (Misc queries) | |||
Can't open files in Excel or Word | Excel Discussion (Misc queries) | |||
Why won't my Word open files in Excel? | Excel Discussion (Misc queries) | |||
How to open various Excel files on its on windows like Word do? | Excel Discussion (Misc queries) |