Ask Your Question
0

problem with excelpy ,does not save the excels automatically

asked 2018-11-13 14:00:35 -0600

omarms92 gravatar image

updated 2018-11-13 15:07:01 -0600

jconto gravatar image

when i use the lib excelpy, does not save the excels automatically when i need to create more than one, even when i only create one.

import psspy
import excelpy

x1 = excelpy.workbook()
x1.worksheet_rename('LINEAS', 'Hoja1', overwritesheet=True)
x1.set_active_sheet('LINEAS')

x1.save('prueba.xlsx')
edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2018-11-13 17:20:21 -0600

omarms92 gravatar image

updated 2018-11-14 12:33:35 -0600

jconto gravatar image

hi i fixit with

import psspy
import excelpy

x1 = excelpy.workbook()
x1.worksheet_rename('LINEAS', 'Hoja1', overwritesheet=True)
x1.set_active_sheet('LINEAS')

x1.show_alerts(False)
dir(x1)
x1.save('prueba.xlsx')
x1.show_alerts(True)
x1.close()
x1.close_app()
edit flag offensive delete link more
0

answered 2018-11-13 15:05:32 -0600

jconto gravatar image

I use PSSe v33.12 + Excel 2013 on a Win7 pc. When using the module excelpy with overwritesheet=True, mode='w' I do not have the problem that you experienced. Excel remains in memory (maybe a microsoft thing) but the xls file created is not locked so I can even delete it. I use the following test code:

import excelpy

x1 = excelpy.workbook(overwritesheet=True, mode='w') 
x1.worksheet_rename('LINEAS', 'Sheet1', overwritesheet=True) 
x1.set_active_sheet('LINEAS')
x1.save('prueba.xlsx')
x1.close()
x1.close_app()
print 'done.'
edit flag offensive delete link more

Comments

thank you, but the code run, in ones pc the excel file is saved in other not, i will try your options, thanks a lot :)

omarms92 gravatar imageomarms92 ( 2018-11-13 17:02:24 -0600 )edit

hi i fixit with import psspy import excelpy x1 = excelpy.workbook() x1.worksheet_rename('LINEAS', 'Hoja1', overwritesheet=True) x1.set_active_sheet('LINEAS') x1.show_alerts(False) dir(x1) x1.save('prueba.xlsx') x1.show_alerts(True) x1.close() x1.close_app()

omarms92 gravatar imageomarms92 ( 2018-11-13 17:18:26 -0600 )edit

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

1 follower

Stats

Asked: 2018-11-13 14:00:35 -0600

Seen: 632 times

Last updated: Nov 14 '18