Sign in with Microsoft
Sign in or create an account.
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

Excel spreadsheets can be imported into XDF files using rxImport via the Excel ODBC interface. Given that the Excel ODBC driver is installed and configured on Windows, an example of code for importing a worksheet "Sheet1" from workbook "C:/Data/ODBCTest.xlsx" would be:

#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 XDF
rxImport(excelDS, excelDS_XDF, overwrite=TRUE)

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Was this information helpful?

What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!