Ask Your Question
0

import pssexcel Excel 2016

asked 2019-07-18 19:19:37 -0500

wyattpython gravatar image

updated 2019-07-18 19:49:17 -0500

The following code was meant to redirect folder path when my computer transition between Window 7 to Windows 10. using the same PSSE 33.4

code_loc = r"C:\Common Modules"

sys.path.append(code_loc)

os.environ['PATH'] = os.environ['path'] + ';' + code_loc

from codedicttofromcsv import *

win10='Y'

win10ch=0

win10=str(input('Are you using windows 10? '))

if str(win10).isdigit()==1:

desired_location=win10

win10ch=1

win10='Y'

if str(win10.upper())=='N': PSSE_LOCATION = r"C:\Program Files\PTI\PSSE33\PSSBIN"

else: PSSE_LOCATION = r"C:\Program Files (x86)\PTI\PSSE33\PSSBIN"

sys.path.append(PSSE_LOCATION)

os.environ['PATH'] = os.environ['path'] + ';' + PSSE_LOCATION

import psspy

import redirect

import pssarrays

import pssexcel

On my old computer(WIndows 7, Excel 2010), the following error comes up when I had an excel file opened that can't be closed immediately. Now that I have my new computer, Windows 10, Excel 2016. I get the following error every time I import pssexcel though I can't find any Excel program on Task Manager.

Traceback (most recent call last):

File "M:\DiagramsPlatypus\Network Security_PSSE Programs\PSSEOutageProg v3.07_Programrun_PSSE.py", line 57, in <module>

import pssexcel

File ".\pssexcel.py", line 36, in <module>

File ".\pssexceluserin.py", line 10, in <module>

File ".\excelpy.py", line 1922, in _getDefaultXLFileExtension

AttributeError: 'NoneType' object has no attribute 'Quit'

Might I know if anyone has any idea what the cause is and how I can fix this, please? I can't find the source code for pssexcel to see what it's after.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2019-07-19 10:57:09 -0500

jconto gravatar image

I am also using Win10 and Excel 2013 but I installed PSSe v.33.12.1 in its default path, without problems! In your code above, the line:

if str(win10.upper())=='N': PSSE_LOCATION = r"C:\Program Files\PTI\PSSE33\PSSBIN"

indicates that your path for Win10 is not the default path. PSSe v33 is a 32-bit program and it is recommended to be installed in the default "C:\Program Files (x86)\PTI\PSSE33" path.

Also, it is better to use the "import psse33" module to set PSSe paths, valid for any OS version:

import psse33     #sets PSSe path
import psspy
import redirect
import pssarrays
import pssexcel
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

Stats

Asked: 2019-07-18 19:19:37 -0500

Seen: 41 times

Last updated: Jul 19