Ciao,
Vorrei creare un programma JMP che restituisca un errore all'utente perché ha selezionato il file Excel sbagliato.
Ecco un esempio del mio programma:
The file_path contains the path to the file selected by the user.
However, I would like to return a message error when the Worksheets( "AAA" ) is not contained in the Excel file selected by the user: because he didn't choose the right Excel file.
Funct = Function( {file_path, visib},
Eval(
Eval Expr(
myTable = Open(
file_path,
Worksheets( "AAA" ),
Use for all sheets( 1 ),
Concatenate Worksheets( 0 ),
..
),
Expr( visib )
)
)
);È possibile creare una condizione if? Se il file selezionato non contiene il foglio di lavoro in questione, JMP restituisce il messaggio error ?
Tuttavia, non so come realizzarlo.
Qualcuno ha una soluzione?
Grazie mille per la tua risposta,
Sebastian
Esiste una funzione chiamata Ottieni fogli di lavoro Excel(). Puoi combinarlo con Throw() o creare la tua finestra modale, ad esempio
Names Default To Here(1);
sheetList = Get Excel Worksheets(
"$SAMPLE_IMPORT_DATA\Team Results.xlsx"
);
If(!Contains(sheetList, "AAA"),
Throw("No 'AAA' found from excel sheet list");
);