A routine ReadExcelSheet() to load Excel data saved in Excel 2003 .xls or a later format (.xlsx, .xlsm, .xlsb...) into a 2D string array is to be written in plain C++. IT SHOULD BE PLATFORM INDEPENDENT AND WORK NOT RELYING ON MS OFFICE, IE. ALSO ON A COMPUTER WITHOUT INSTALLED EXCEL.
The data should be loaded into memory in the form of strings, the way they are shown on the screen -- eg. if an Excel cell shows 1.234,567.89, and undelying number is 1234567.890123, the loaded string should read "1.234,567.89". The range to be loaded starts at A1 and ends at the last cell in the sheet (presumably the one that is selected with Ctrl+End). All situations must be supported, including Unicode.
The routine should be made so to operate on a single Excel sheet, with the sheet name as a parameter. Another routine should be provided to return names of all the sheets that are present in the Excel file, so that ReadExcelSheet() can be called with that information for each sheet.
A “reverse“ routine WriteExcelSheet(), to write data into a 2003 or later Excel format file, should also be provided. The routine should be able to automatically write data into more than one Excel sheet (within the same Excel file) if the data is longer and/or wider than the Excel format's limits allow.
All the routines should be delivered with examples of usage.