During my daily task allocation I came across a task in which I was supposed to create excel from SharePoint list and then send the created excel via email. The procedure was to be repeated daily. I used timer job to repeat task on daily basis. As I was unaware of the column that may exist in SharePoint list so I thought of using SharePoint views (i.e., AllItems ) to get the list of fields. Also this facilitated my code to be dynamic enough to be replaces with custom created views. Add a new class file to project: Right click project > Add > class Name class file: ListToExcelGenerator namespace xxx { /// <summary> /// Class to create Excel from Sharepoint List /// </summary> class ListToExcelGenerator { /// <summary> /// Sets file path as well file name. /// </summary> ...