Open a file - Application unknown

S

Snirp

I want to be able to open a file without stating the application to
open it. Not unlike adding a hyperlink to a cell value.

Only, I want it done in VBA since it must take some variables. The
following works great if the path to the application is known.

Dim x As Variant
x = Shell( AppPath & " " & FilePath, 1)

However, i want it to take the windows default application to open the
file. Again, much like the result a hyperlink produces. Simply
omitting the AppPath results in an Error 5, something like "invalid
procedure call or invalid argument".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top