Openrowset to a different excel-file depending on condition

If you don't want to use dynamic sql you can always check if the file exists or you can catch the error and continue.

File Validation in SQL Server with xp_fileexist (sqlshack.com)

Nice error handling example
sql server - Check file exists with T-SQL openrowset - Stack Overflow