check whether spreadsheet has blank rows or invalid data in any cells and alert the user if it does read data from spreadsheet and use it as the input for your python programs writing excel documents openpyxl also provides ways of writing datameaning that your programs can create and edit spreadsheet files with pythonit' simple to create spreadsheets with thousands of rows of data creating and saving excel documents call the openpyxl workbook(function to create newblank workbook object enter the following into the interactive shellimport openpyxl wb openpyxl workbook(create blank workbook wb sheetnames it starts with one sheet ['sheet'sheet wb active sheet title 'sheetsheet title 'spam bacon eggs sheetchange title wb sheetnames ['spam bacon eggs sheet'the workbook will start off with single sheet named sheet you can change the name of the sheet by storing new string in its title attribute any time you modify the workbook object or its sheets and cellsthe spreadsheet file will not be saved until you call the save(workbook method enter the following into the interactive shell (with example xlsx in the current working directory)import openpyxl wb openpyxl load_workbook('example xlsx'sheet wb active sheet title 'spam spam spamwb save('example_copy xlsx'save the workbook herewe change the name of our sheet to save our changeswe pass filename as string to the save(method passing different filename than the originalsuch as 'example_copy xlsx'saves the changes to copy of the spreadsheet whenever you edit spreadsheet you've loaded from fileyou should always save the newedited spreadsheet to different filename than the original that wayyou'll still have the original spreadsheet file to work with in case bug in your code caused the newsaved file to have incorrect or corrupt data working with excel spreadsheets