I am trying to read an Excel file with odbcConnectExcel2007 function from RODBC package. It works fine when the file is not in use. But when it is, I get the error:
Warning messages: 1: In odbcDriverConnect(con, tabQuote = c("[", "]"), ...) : [RODBC] ERROR: state HY000, code -1028, message [Microsoft][ODBC Excel Driver] Cannot open database '(unknown)'. It may not be a database that your application recognizes, or the file may be corrupt. 2: In odbcDriverConnect(con, tabQuote = c("[", "]"), ...) : ODBC connection failed
I have also tried to include readOnly = TRUE in the function specification, but still no luck. Any ideas anyone?
RODBC, imo there are better alternatives for reading in excel files, includingreadxl,gdataorXLConnect- mtoto