Click here to Skip to main content
15,904,655 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everyone i have a task,

It is a windows form applicaiton,my UI is having an input folder select button to choose a folder path,have some files in that folder with unique file names and also i have textbox for user input purpose.
so finally user gives a particular file name then it will open automatically..


i have almost the task it saerch the file based on user input but i am lagging to open that file automatically...will anyone plz help me???
Posted
Comments
Dave Kreskowiak 1-Feb-16 13:05pm    
Define what you mean by "open". Are you opening the thing in Excel or are you reading the data from the workbook and displaying it in your own application?

If it's just opening it in Excel, all you have to do is launch the selected file using the Process class.
ZurdoDev 1-Feb-16 13:54pm    
OP ended up using your suggestion. Please post as a solution.
NagaNimesh 11474558 1-Feb-16 13:09pm    
no i dont want to read else write or anything.I want to launch that particular file..
NagaNimesh 11474558 1-Feb-16 13:13pm    
i tried like this..
1)using browse button user will select a folder having somany files
2)now all those files will kept in an array
3)now im comparing the user input file name among all file names in that folder using if condition.
4)so finally condition gets true now im struggling to launch that file..

will u please help me??
NagaNimesh 11474558 1-Feb-16 13:18pm    
hyyy i got the solution .
Tanq so much for your reply.here is the step
System.Diagnostics.Process.Start("myFile.xls");

1 solution

C#
System.Diagnostics.Process.Start("myFile.xls");
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900