Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #98906

Re: write data in Excel using python

Newsgroups comp.lang.python
Date 2015-11-16 17:43 -0800
References <3267f6a3-a047-4abf-80bf-8fdba3659223@googlegroups.com>
Message-ID <317940a3-ac2f-4d0a-8ed5-9395cca9835b@googlegroups.com> (permalink)
Subject Re: write data in Excel using python
From tdsperth@gmail.com

Show all headers | View raw


On Tuesday, November 17, 2015 at 1:14:56 AM UTC+8, SW wrote:
> hi, 
> I am trying to write Excel file suing output from another software where the output comes as myturnlist.Show()
> 
> The first part is for the output from the software which is saved in the clipboard. 
> 
> The big middle part works to open Excel and save the data into excel file called "TurnData.xlsx". 
> 
> For some reason it doesn't save the file. 
> 
> Any idea?
> 
> Thanks in advance.
> 
> 
> import VisumPy.excel
> 
> # Write to Excel
> 
> myturnlist.Show()
> turnData = myturnlist.SaveToClipboard(59,0)
> 
> excel = win32com.client.Dispatch("Excel.Application")
> wb = excel.Workbooks.Add()
> exce.Visible = True
> wb.WorkSheets[0].Paste()
> excel.activeWorkbook.SaveAs ("c:\TurnData.xlsx")
> 
> myturnlist.Close()

Take out exce.Visible = True ( which I believe is atypo)

Colin

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

write data in Excel using python syedmwaliullah@gmail.com - 2015-11-16 09:14 -0800
  Re: write data in Excel using python Michiel Overtoom <motoom@xs4all.nl> - 2015-11-16 19:20 +0100
  Re: write data in Excel using python Ian Kelly <ian.g.kelly@gmail.com> - 2015-11-16 17:22 -0700
  Re: write data in Excel using python tdsperth@gmail.com - 2015-11-16 17:43 -0800

csiph-web