我的代码是
#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) 我正在尝试打开使用epplus编写的Excel文件。
我使用它打开它,它可以在开发服务器中使用,但发布后不能使用。
System.Diagnostics.Process.Start(Server.MapPath("~\chart.xlsx"))
Run Code Online (Sandbox Code Playgroud)
我该如何打开这个Excel表格?