LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Open .csv file in Excel

Solved!
Go to solution

If I double click a .csv file in Windows Explorer, then Excel runs and the file is opened.

 

Is it possible to get LabVIEW to do this?

 

The problem is, I don't know which version of Excel will be installed, and I also need to accomodate future versions.

 

Everything I've found with a search seems use to system_exec.vi with a constant pointing to the location (in c:\program files\microsoft office....etc) of a particular version of Excel

 

So what I want is to have a button which fires an event which takes the specified .csv file and runs whatever version of Excel is installed to open the file.

0 Kudos
Message 1 of 4
(2,790 Views)

start file.csv will start whatever application is associated with CSV files.

 

Br, Miha

0 Kudos
Message 2 of 4
(2,784 Views)
Solution
Accepted by topic author sebster

@Miha_Vitorovic wrote:

start file.csv will start whatever application is associated with CSV files.

 

Br, Miha


Oh, right. You will most probably need to start cmd.exe to do this: something like

cmd.exe /c "start c:\path\file.csv"

Message 3 of 4
(2,780 Views)

Oooooooh almost.

 

It's on the right track, but, as is explained here, there needs to be a further pair of quotes in the command line.

 

So it actually needs something like cmd.exe /c start "" "c:\path\file.csv"

 

If the extra quotes aren't there then it opens a command prompt window with the path and filename as the window title (WHY???)

 

But using START is the correct solution, so I'm going to credit you with that.

 

 

Thanks.

0 Kudos
Message 4 of 4
(2,762 Views)