In real scenario i am having a data more than 15 to 20 lacs, it may increase also, as i want to share data in to .xlsx file i required to split the data into 5 lacs records. E.g. If my records are 20 lacs then i will get the the 5 files containing 5 lacs records in each file.
Thanks Anjos.. code is working perfectly. I have made only one change instead of .text i have put .csv and it is working perfectly. But if i want to save the file into .xlsx whether it is possible.