c++ and Excel?
You're going to be using a sledgehammer to crack a peanut. A simple ini file will suffice and it won't require the same level of development.
Also to read excel you usually need to use COM which means that the user of your game will need a license for office. In my opinion that's a big assumption to make because office isn't essential.
Also office is about as performant as a snail stuck in salty treacle. It won't scale for a game inventory.
This seems to be two issues, using Excel to populate data used by your game, and having Diablo-style random generated loot at game run-time.
In the first place you could use xlsx spreadsheets to keep track of the data and when it's ready for your game, export snapshots of your spreadsheet to a csv files. Then your game would read the csv file in and treat the data as integers or text as you deem appropriate. It depends on exactly what benefits you think using Excel gives you, since you could use a text file if you wanted to.
The second issue, having Diablo-style random generated loot, is a combination of data and code. If you want a weapon to have range of stats randomly assigned you can use the spreadsheet to give a weapon a certain spread. Weapon damage (or whatever) could be assigned a low value of 10 and a high value of 15. Then your code would read that in from the spreadsheet and generate the random number between 10 and 15. You might want to look up into the different random number distributions. For example, say you want your items to have a high probability of being 10 and lower probabilities of getting higher numbers. You could use a Poisson distribution for this. Or you want a high probability of 12 occurring and numbers lower/higher than 12 being less and less likely the further you get form 12 (a binormal distribution).
- make stuff, order data in your Excel file
- copy paste all columns and rows to an ascii file (or export/ use csv)
- simply read in the ascii file, for example with a standard ifstream
This works pretty easy and fine, just make sure not to put rubbish between the logical data.
A column switch in excel is exactly like a tab in ascii and a row like a newline
It is also possible to create a custom exporter for Excel, if csv doesn't cut it for some reason.
Office plugin development can now be done for free - first, download the Visual Studio 2013 Community Edition, and then the Office Tools for VS 2013.
That said, the CSV way is somewhat easier if it fits your needs :)
The xlsx format is not impossible to work with either. It is effectively a zip file that contains XML files (and media) that describe the document contents.
The format is not as trivial to read as a flat file, though. One of the reasons for the complexity is that you have a "shared string" table which is used to look up strings for the cell values. The values of cells that have a type of "s" need to be looked up from said table using an ordinal number stored with the cell.
All this means that you can't simply enumerate over the sheets like flat records. Which is what a format like CSV trivially enables.
As previous commenters stated, excel may not be the right format for your data. I also think, that CSV or a custom format (maybe XML/JSON mixed with CSV) would be a better choice.
But for future reference (or if you really want to use excel for you inventory system), there exists a Qt5 library for reading and writing from/to excel spreadsheets (.xlsx files): QtXlsx. The library doesn't need office to read spreadsheets and is distributed under the MIT license (see its documentation), so you don't have to worry about licensing issues. I have not tried the library, but it looks capable enough to parse spreadsheets correctly. It depends on you if you want to introduce Qt5 as a dependency though.