Microsoft Excel 11.0 Object Library should be added as Reference to get the features for interacting with Excel. As you have guessed, the Excel file has turned out to be a normal database.
It is both fast and effective for non-cryptographic applications.
Two ways for generating Excel report will be discussed in this tutorial. In this tutorial, you learned how to read data from Excel, generate report using the Response objects and to play with the Microsoft Excel 11.0 objects provided.
The first one is using the "Response" class and the second one by manipulating the Excel objects that "Microsoft Excel 11.0" Objects provide. The x-axis consists of the names and id of each student. Indeed, it is impossible to cover all features in this tutorial but many important techniques were covered to help you down the line.
It should be possible to generate tens of millions of random numbers in less than a second on a standard CPU with this technique.
EDIT: Although the above is technically correct, DSimon's answer is probably more useful in practice. I have seen a lot of implementations of rejection sampling and it is often very difficult to see if it's correct or not. The boost implementation is rather easy to use and is well tested in many real-world applications.