I want to write some data to an xlsx spreadshhet (ultimately into an existing one with multiple shhets, but for now would be happy with creating a blank single sheet file).
Looking around it seems I need to use the excel ODBC driver (Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)) to write data into the spread sheet.
However this fails with: "Driver not installed: Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)"
I have the 64bit version of Office 2010 Pro Plus (I think thats the version students get?) installed, on Windows 7 Home 64bit. And am trying to create a 32bit application.
Is there some fundamental issue using ODBC here with office and windows editions, or the bitness of the application? Is ODBC the best choice here for simply writing some data into a file?
A requirment is also that I can write any file, and excel doesnt need to be open (but excel 2007 or later will be installed on the system).
CString sDriver = L"Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)";
CString sExcelFile = L"c:\\test.xlsx";
CString connect;
connect.Format(L"DRIVER={%s};DSN='';FIRSTROWHASNAMES=1;READONLY=FALSE;CREATE_DB=\"%s\";DBQ=%s",
sDriver, sExcelFile, sExcelFile);