import openpyxl from openpyxl import Workbook import pandas as pd from openpyxl.utils.dataframe import dataframe_to_rows class Excel_Operation (): def Create_Workbook ( self , strWorkbookPath ): """Create New excel workbook in the given folder location Parameters: strWorkbookPath (String): Path to store excel workbook Returns: Object: Workbook """ wb = Workbook() wb.save(strWorkbookPath) return wb def Load_Workbook ( self , strWorkbookPath ): wb = openpyxl.load_workbook(strWorkbookPath) return wb def Change_worksheetName ( self , strWorkbookPath , strOldSheetName , strNewSheetName ): wb = openpyxl.load_workbook(strWorkbookPath) ws = wb[strOldSheetName] ws.title = strNewSheetName wb.save(strWorkbookPath) def Create_Worksheet ( self , strWorkbookPath , intIndex , strWorkSheetName ): wb = openpyxl.load