How to open xls file with Excel in VB

So how can I tell the system to open the file for me? I tried

Shell(ExcelFilePath)

But an exception was thrown, although the file path from OpenFileDialog.FileOk

So, I'm trying to play with Excel.Application, is it possible to open a file with this?

+5
source share
2 answers

This will open the file with Excel:

Process.Start("EXCEL.EXE", """C:\Folder\file.xls""")

Being the second line, arguments for the process. See MSDN Dcoumentation .

+7
source

try it

System.Diagnostics.Process.Start("FilePath")

it will open the file in the application associated with it.

+4
source

All Articles