I need to use the open function with a relative file location. The following code finds the location, and stores the path to the file in the variable RelativeLocation
relativePath = Get Default Directory();
UPtwo = Left( relativePath, Contains( relativePath, "/Folder/", -2 ) );
RelativeLocation = UPtwo || "Excel_file.xlsx";
However, when using the Open function with the RelativeLocation
variable, the script crashes. Here is an example:
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( "-" )
)
);
This gives the following error message: