You will need to use dynamic SQL. OPENROWSET etc. allows literals as parameters.
DECLARE @myfile varchar(800) SET @myfile = 'C:\template.xls' EXEC (' insert into OPENROWSET(''Microsoft.Jet.OLEDB.4.0'', ''Excel 8.0;Database=' + @myfile + ';'', ''SELECT * FROM [SheetName$]'') select * from myTable ')
Remember: the path refers to where SQL Server is running
source share