Ivan Calandra wrote: > > ... > > for (i in 1:4){ > sqlSave(xlsFile, as.data.frame(test[[i]]), tablename="test", rownames=F, > addPK=T, append=T) > } > Error in odbcUpdate(channel, query, mydata, coldata[m, ], test = test, > : missing columns in 'data' > > odbcCloseAll() > >
I have never managed to write to Excel with ODBC with "append=TRUE". If you do not want to Access instead where this works, best is to collect (rbind) the data in an R data frame, and write everything in one chunk. Dieter -- View this message in context: http://n4.nabble.com/problem-with-looping-on-sqlSave-tp1567601p1567872.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.