LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default launch any file type from excel macro

I have a macro that lists all the files relating to a project in
single worksheet. As the file list and the directory tree is ver
large, I am trying to write a macro that will launch the selected fil
from the list.

I have managed to work out how to launch .xls and .doc files
using the following code by taking 'file' from the active cell


' file is the full path

If Right(file, 3) = "xls" Then
Workbooks.Open file
End If

If Right(file, 3) = "doc" Then
Set wdapp = CreateObject("Word.Application")
With wdapp
.Documents.Open file
.Visible = True
End With
End If

but this seems a bit cumbersome as there are CAD files, MS projec
files, JPGs, Acrobat files etc.

Is there a universal command that will launch any file type or som
other clever work around.

Cheers

Arro

--
Message posted from http://www.ExcelForum.com

 
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
Pass parameter to launch batch file with variable from excel Frank Pozzuto New Users to Excel 0 January 15th 10 06:17 PM
2007 Excel will not launch from file Barbara Excel Discussion (Misc queries) 2 July 31st 08 06:36 PM
File won't launch eric blom Excel Discussion (Misc queries) 1 September 17th 07 10:30 PM
How do I auto launch an excel file upon log in? Starion Excel Discussion (Misc queries) 1 April 24th 06 08:02 PM
Launch Macro in Access via Macro running in Excel??? dgrant Excel Programming 1 September 24th 03 01:38 PM


All times are GMT +1. The time now is 03:27 PM.

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"