Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Using Shell to open files with more than one word in their name

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
cannot get certain files and folders to open in xcel and word vikes fan Excel Discussion (Misc queries) 2 February 22nd 07 05:25 PM
Excel and Word will not open saved files Flannagan Excel Discussion (Misc queries) 2 April 26th 06 09:25 AM
Can't open files in Excel or Word rortiz Excel Discussion (Misc queries) 2 April 19th 06 01:32 AM
Using Shell to open files with more than one word in their name Tom Ogilvy Excel Programming 0 March 16th 06 06:55 PM
Why won't my Word open files in Excel? p-oedkc Excel Discussion (Misc queries) 1 February 14th 06 10:07 AM


All times are GMT +1. The time now is 09:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"