You can either use excelpy or CSV module. I would stick to CSV if you were to store plain data, i.e. no requirements for features of XLSX etc.
First of all, get the data that you need.
# get bus numbers, circuit IDs and loading of in-service branches
ierr,busnum = psspy.abrnint(string=['FROMNUMBER','TONUMBER'])
ierr,ckt = psspy.abrnchar(string='ID')
ierr,loading = psspy.abrnreal(string=['P','Q'])
CSV option:
import csv
# open a CSV file for writing
csv_out = open('branch_flows.csv','wb')
# create the csv writer object
csvobj= csv.writer(csv_out)
# write header
csvobj.writerow(('From bus','To bus','ID','MW','MVAr'))
# write data
csvobj.writerows(zip(busnum[0],busnum[1],ckt[0],loading[0],loading[1]))
# close CSV file
csv_out.close()
excelpy option:
import excelpy
# create a Excel workbook for writing
xlobj = excelpy.workbook()
# write header
xlobj.set_range(1,'a',['From bus','To bus','ID','MW','MVAr'])
# write data
xlobj.set_range(2,'a',zip(*busnum))
xlobj.set_range(2,'c',zip(*ckt))
xlobj.set_range(2,'d',zip(*loading))
# save workbook
xlobj.save('branch_flows.xlsx')