Recall the sheet name from excel
linepic
Tue, 02/14/2017 - 07:43 pm
I may need to recall the name of each sheet to load the data in the sheets.
Is there any way to recall the names to get the data inside?
Tue, 02/14/2017 - 07:43 pm
XLLoadWave/J=1
to get a list of the sheet names in the stringS_value
then load each one individually.Here is an example cut from a larger procedure file.
/// @param pref prefix for excel workbook e.g. "ctrl_"
Function LoadMigration(pref)
String pref
String sheet, prefix, wList
Variable i
XLLoadWave/J=1
Variable moviemax = ItemsInList(S_value)
NewPath/O/Q path1, S_path
for(i = 0; i < moviemax; i += 1)
sheet = StringFromList(i,S_Value)
prefix = pref + num2str(i)
XLLoadWave/S=sheet/R=(A1,H1000)/O/K=0/N=$prefix/P=path1 S_fileName
wList = wavelist(prefix + "*",";","") // make matrices
Concatenate/O/KILL wList, $prefix
endfor
Print "***\r Condition", pref, "was loaded from", S_path,"\r ***"
End
February 14, 2017 at 11:01 pm - Permalink