open file from subdirectory

K

K

Hi all, I am looking for VB.NET code (not VB6 code) which should look
for file name "526366.xlsx" in all subfolders under folder "C\data"
and then it should show message if it cant find the file like "sorry
file not found" and if it finds the file then it should open it.
Please can any friend help me on this.
 
O

Onur Güzel

Hi all,  I am looking for VB.NET code (not VB6 code) which should look
for file name "526366.xlsx" in all subfolders under folder "C\data"
and then it should show message if it cant find the file like "sorry
file not found" and if it finds the file then it should open it.
Please can any friend help me on this.

Use File.Exists, then if it returns True, use Process.Start(...) and
launch the file, else use Msgbox("....") to warn user that the file
doesn't exist.

HTH.

Onur
 

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