Lookout

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing Spreadsheet Object CSV Files w/Combobox

okay @Ryan has got me way down the road on this so far....showed me how to change control panels with combobox....now he has showed me how to change csv files with activex spreadsheet viewer....but now i want to pull up the csv files that my spreadsheet object logs to on a daily basis into folders year...month....day...filename.....i need to know how to choose which file to open...that is how to drill down into the month and day folders to open the file to view it....my thinking is to use a couple of comboboxes for the month and day with a go button but that may not be the right way....i've also tried the microsoft date and time picker but it makes other objects on my control panel dissappear......somebody i know knows how to do this....thanks..randy
0 Kudos
Message 1 of 18
(5,630 Views)
I think I have answered this question. My example uses one combobox, but it's the same to use 2 or 3 to select the month and day. It does work on my computer.
For example, we have combobox1 for year, combobox2 for month and combobox3 for day. And you need to open the file c:\year\month\day\data.csv. Let's use "Run" object this time to open the file directly in excel. In Run object setting, "Run when" is the go button. "Command line" can be in this way,
"C:\Program Files\Microsoft Office\Office10\Excel.exe "&"c:\"&ComboBox1.properties.selectedItem&"\"
&ComboBox2.properties.selectedItem&"\"&ComboBox3.properties.selectedItem&"\data.csv"

帖子被@Ryan在06-12-2006 10:03 AM时编辑过了

帖子被@Ryan在06-12-2006 10:04 AM时编辑过了

帖子被@Ryan在06-12-2006 10:05 AM时编辑过了

Ryan Shi
National Instruments
0 Kudos
Message 2 of 18
(5,611 Views)
thanks...i finally got it to work....like to never found the space between excel.exe and "....randy
0 Kudos
Message 3 of 18
(5,578 Views)
what is the correct syntax i guess is the right word for my command line to get the right csv file to open.......lookout is storing my files daily under c:\Program Files\National Instruments\Lookout 6.0\Side 2 Material Log.Csv
i can make it open it if it is in c:\ but i can't figure out to make it drill down through the directory tree....thanks..randy
0 Kudos
Message 4 of 18
(5,541 Views)

my bad   c:\Program Files\National Instruments\Lookout 6.0\Month\Day\Side 2 Daily Log

i've got the month and day part with the comboboxes it's just the rest

0 Kudos
Message 5 of 18
(5,537 Views)
"C:\Program Files\Microsoft Office\Office10\Excel.exe "&"c:\Program Files\National Instruments\Lookout 6.0\"& ComboBox1.properties.selectedItem&"\"
&ComboBox2.properties.selectedItem&"\Side 2 Daily Log.csv"
 
ComboBox1 is the month.
ComboBox2 is the day.

帖子被@Ryan在06-21-2006 01:57 PM时编辑过了

Ryan Shi
National Instruments
0 Kudos
Message 6 of 18
(5,535 Views)

i don't know what i am doing wrong....here is my command line in the expression box

"C:\Program Files\Microsoft Office\Offiice10\Excel.Exe "&c:\Program Files\National

Instruments\Lookout

6.0\2006\"&DailyTotalsMonthCombobox.properties.selecteditem&"\"&DailyTotalsDayCombobox.propertie

s.selecteditem&"\dailytotals.csv"

when i press go button i get

'c:\Program.xls' could not be found             Press ok

'Files\National.xls' could not be found         Press ok

'Instruments\Lookout.xls' could not be found  Press ok

'6.0\2006\June\22\dailytotals.csv' could not be found  Press ok

then a blank excel spreadsheet opens.....what have i got wrong

0 Kudos
Message 7 of 18
(5,524 Views)
At least, there should be a " before c:\Program Files\National.
Ryan Shi
National Instruments
0 Kudos
Message 8 of 18
(5,522 Views)
sorry...yes i have that... 
0 Kudos
Message 9 of 18
(5,518 Views)
my fault. I didn't notice the space between "program" and "files".
 
Try again. It should work this time.
"C:\Program Files\Microsoft Office\Offiice10\Excel.Exe "&"""c:\Program Files\National Instruments\Lookout 6.0\2006\"&DailyTotalsMonthCombobox.properties.selecteditem&"\"&DailyTotalsDayCombobox.properties.selecteditem&"\dailytotals.csv"""
Ryan Shi
National Instruments
0 Kudos
Message 10 of 18
(5,510 Views)