小编Drf*_*ink的帖子

excel访问被win32 python pywin32拒绝

我的代码是

#Opens template for creating final report
excel = win32.dynamic.Dispatch('Excel.Application')
template = os.path.abspath((folderpath+'\Poop.xlsx'))
wb = excel.Workbooks.Open(template)
freshws= wb.Sheets("Fresh") #Sheet names must match perfectly
secws= wb.Sheets("sec")

cur.execute("Select * from FIRALL")
freshdata=list(cur.fetchall())
#writes to the first sheet
datarowlen=0
for i,a in enumerate(freshdata):
    datarowlen = len(a)
    for j,b in enumerate(a):
        freshws.Cells(i+1,j+1).Value = a[j]

cur.execute("Select * from SECVE")
secdata=list(cur.fetchall())
#writes to the second sheet
datarowlen=0
for i,a in enumerate(secdata):
    datarowlen = len(a)
    for j,b in enumerate(a):
        secws.Cells(i+1,j+1).Value = a[j]
#saves the report
wb.SaveAs()
wb.Close() …
Run Code Online (Sandbox Code Playgroud)

python excel winapi pywin32 win32com

1
推荐指数
2
解决办法
4389
查看次数

使用EPPlus打开Excel

我正在尝试打开使用epplus编写的Excel文件。

我使用它打开它,它可以在开发服务器中使用,但发布后不能使用。

System.Diagnostics.Process.Start(Server.MapPath("~\chart.xlsx"))
Run Code Online (Sandbox Code Playgroud)

我该如何打开这个Excel表格?

vb.net asp.net excel epplus

0
推荐指数
1
解决办法
1390
查看次数

标签 统计

excel ×2

asp.net ×1

epplus ×1

python ×1

pywin32 ×1

vb.net ×1

win32com ×1

winapi ×1