First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!

Ask Your Question
1

pssexcel never generates file

asked Aug 27 '14

JoshCorp gravatar image

I have an automation for running multiple accc scenarios and I was hoping to add in a line at the end to output the results to excel. I have used the pssexcel command previously without issue but never within a loop. When it runs, everything seems to go as planned without error except that the excel files are never created. The output window even says that the results have been output to file but the file is never generated.

Has anyone had this problem before? Thanks!

Comments

It might be getting stored in C:\Program Files (x86)\PTI\PSSE33\EXAMPLE or PSSBIN folder !

Mahesh gravatar imageMahesh (Aug 28 '14)

1 answer

Sort by » oldest newest most voted
1

answered Aug 28 '14

Eli Pack gravatar image

I've had success exporting ACCC results to Excel in a loop, but I tend to put them in different sheets within the one file. Here is some of my code:

import pssexcel

THISFOLDER = os.path.abspath(os.path.dirname(sys.argv[0])) # You may need to change this line with your folder location.
# Look through all files in the directory looking for the right extension
accfiles = []
for f in os.listdir(THISFOLDER):
    if f.lower().endswith(".acc"):
        accfiles.append(f)

total_files = len(accfiles)
count = 0
for accfile in accfiles:
    count = count + 1
    print "Processing ACCC file", count, "of", total_files
    print "File =", accfile
    xlsfile = "ACCC_Results.xls"
    sheet = accfile[:-4]
    print "SHEET =", sheet
    pssexcel.accc(THISFOLDER + "\\" + accfile, ['s','e','b'], colabel='', stype='contingency',busmsm=0.5, sysmsm=5.0, rating='a', namesplit=True, xlsfile=xlsfile,sheet=sheet, overwritesheet=True, show=True, ratecon='c',baseflowvio=False, basevoltvio=False, flowlimit=90.0, flowchange=0.0,voltchange=0.0)
print "Script finished."
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.
Want to format code in your answer? Here is a one minute demo on Youtube

Add Answer

[hide preview]

Question Tools

Stats

Asked: Aug 27 '14

Seen: 491 times

Last updated: Aug 27 '14