Devo utilizzare la funzione open con una posizione del file relativa. Il codice seguente trova la posizione e memorizza il percorso del file nella variabile Posizione relativa
relativePath = Get Default Directory();
UPtwo = Left( relativePath, Contains( relativePath, "/Folder/", -2 ) );
RelativeLocation = UPtwo || "Excel_file.xlsx";
Tuttavia, quando si utilizza il Aprire funzionare con il Posizione relativa variabile, lo script si blocca. Ecco un esempio:
Open(RelativeLocation,
Worksheets( "Summary" ),
Use for all sheets( 1 ),
Concatenate Worksheets( 0 ),
Create Concatenation Column( 0 ),
Worksheet Settings(
1,
Has Column Headers( 1 ),
Number of Rows in Headers( 1 ),
Headers Start on Row( 3 ),
Data Starts on Row( 4 ),
Data Starts on Column( 1 ),
Data Ends on Row( 0 ),
Data Ends on Column( 0 ),
Replicated Spanned Rows( 1 ),
Replicated Spanned Headers( 0 ),
Suppress Hidden Rows( 1 ),
Suppress Hidden Columns( 0 ),
Suppress Empty Columns( 0 ),
Treat as Hierarchy( 0 ),
Multiple Series Stack( 0 ),
Import Cell Colors( 0 ),
Limit Column Detect( 0 ),
Column Separator String( "-" )
)
);
Ciò restituisce il seguente messaggio di errore:

Forse inizia inserendo un paio di linee diagnostiche prima di aprire:
show( RelativeLocation );
show( FileExists(RelativeLocation) );
Molte grazie, @David_Burnham !
show( FileExists(RelativeLocation) );
ha dato una risposta negativa e
show( RelativeLocation );
indicato che il percorso non era corretto. Quindi, dopo aver risolto il guasto, tutto funziona come previsto!