Fogli di calcolo Excel può essere importati in file XDF mediante rxImport tramite l'interfaccia ODBC di Excel. Dato che il driver ODBC di Excel è installato e configurato in Windows, un esempio di codice per l'importazione di un foglio di lavoro che potrebbe essere "Sheet1" dalla cartella di lavoro "C:/Data/ODBCTest.xlsx":
#Define ODBC connection string.connectionStr <- "Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DriverId=790;Dbq=C:/Data/ODBCTest.xlsx;DefaultDir=c:/Data;"#Define ODBC query into workbook. The worksheet name must be followed by '$' and enclosed in [].testExcel = "SELECT * FROM [Sheet1$]"#Define ODBC data source for the import using the query and connection string.excelDS<- RxOdbcData(sqlQuery = testExcel, connectionString=connectionStr)#Define input workbook and output xdf file.excelDS_XDF<- RxXdfData("testFromExcel.xdf")#Import the workbook into the XDFrxImport(excelDS, excelDS_XDF, overwrite=TRUE)