Re: [python-win32] Excel cannot open or save

2020-09-22 Thread Shaik Saleem Basha
Try to remove access rights for excel file or use python schedule library. Regards,Saleem.From: João Pedro Arruda LemeSent: Wednesday, September 23, 2020 3:27 AMTo: python-win32@python.orgSubject: [python-win32] Excel cannot open or save Hello, I've been facing a problem when trying to exec

[python-win32] Excel cannot open or save

2020-09-22 Thread João Pedro Arruda Leme
Hello, I've been facing a problem when trying to execute a scheduled task (Windows Task Scheduler) that calls a Python script making use of pywin32. The script is very simple, it opens Excel, writes 3 cells, saves and closes it. I can execute it directly by the Administrator and, using runas, I c

Re: [python-win32] Excel / Word: setting properties

2018-03-02 Thread Niemann, Hartmut
m www.siemens.com/ingenuityforlife<https://siemens.com/ingenuityforlife> Von: python-win32 [mailto:python-win32-bounces+hartmut.niemann=siemens@python.org] Im Auftrag von Tim Roberts Gesendet: Freitag, 2. März 2018 09:13 An: Python-Win32 List Betreff: Re: [python-win32] Excel / Word: setting pr

Re: [python-win32] Excel / Word: setting properties

2018-03-02 Thread Tim Roberts
On Mar 2, 2018, at 12:07 AM, Niemann, Hartmut wrote: > > print ('%r' % workbook.BuiltinDocumentProperties) > > gives me > > > > > What can I do with such an object? Are you checking the Word object model? The BuiltinDocumetProperties method returns a DocumentProperties object. I believe

Re: [python-win32] Excel / Word: setting properties

2018-03-02 Thread Niemann, Hartmut
Februar 2018 18:20 An: Python-Win32 List Betreff: Re: [python-win32] Excel / Word: setting properties Niemann, Hartmut wrote: > >   > > How do I set the [Excel workbook] standard property "Keywords" to > "C_Restricted" and the user property "Document Confid

Re: [python-win32] Excel / Word: setting properties

2018-02-28 Thread Tim Roberts
Niemann, Hartmut wrote: > >   > > I create an excel document using the COM interface. > >   > > Now I need to set two properties to be compatible with a new company rule: > >   > > “[the tool] uses MS Office standard (‘Keyword’) and custom (‘Document > Confidentiality’) properties. so if your code

[python-win32] Excel / Word: setting properties

2018-02-28 Thread Niemann, Hartmut
Hi! I create an excel document using the COM interface. Now I need to set two properties to be compatible with a new company rule: "[the tool] uses MS Office standard ('Keyword') and custom ('Document Confidentiality') properties. so if your code is able to preset values to these properties [ev

Re: [python-win32] Excel to python COM not working. Please help!

2015-12-28 Thread Tim Roberts
Tarun Kapoor wrote: > I am supporting this old legacy code that someone else wrote. A user > had their computer replaced and the code stopped working. We have some > code written in python that we want to access from Excel. We register > the python COM like shown below > ... > Just for the sake of

[python-win32] Excel to python COM not working. Please help!

2015-12-25 Thread Tarun Kapoor
I am supporting this old legacy code that someone else wrote. A user had their computer replaced and the code stopped working. We have some code written in python that we want to access from Excel. We register the python COM like shown below class COMWSdbAccess: _reg_clsid_ = "{505D2E5B-17EC-

Re: [python-win32] Excel Paste Special Error

2014-07-28 Thread Tim Roberts
Qing Xu wrote: > Hi All > > Original code: > > import win32com.client > import win32clipboard > from win32com.client import Dispatch > > ws_fc_ipn.PasteSpecial(Paste=-4163) It would be better to use the symbolic names, like win32com.client.constants.xlPasteValues. Or: from win32com.client imp

[python-win32] Excel Paste Special Error

2014-07-28 Thread Qing Xu
Hi All Original code: import win32com.client import win32clipboard from win32com.client import Dispatch ws_fc_ipn.PasteSpecial(Paste=-4163) Wanted copy and paste special (paste value) to selection. Gave me "Type Error: PasteSpecial() got an unexpected keyword argument 'Paste' " If anyone kno

Re: [python-win32] Excel Characters object

2014-05-28 Thread Niemann, Hartmut
Tim Roberts wrote: >Niemann, Hartmut wrote:   >>I want to create an Excel file through the python COM interface. >>I can open the file, fill the cells, save the file.   >>Now I want to color single characters in the cell content.   >>In VBA ( see >>http://stackoverflow.com/questions/7618121/excel-

Re: [python-win32] Excel Characters object

2014-05-27 Thread Tim Roberts
Niemann, Hartmut wrote: > > > I want to create an Excel file through the python COM interface. > > I can open the file, fill the cells, save the file. > > > > Now I want to color single characters in the cell content. > > > > In VBA ( see > > http://stackoverflow.com/questions/7618121/excel-v

[python-win32] Excel Characters object

2014-05-27 Thread Niemann, Hartmut
Hello! I want to create an Excel file through the python COM interface. I can open the file, fill the cells, save the file. Now I want to color single characters in the cell content. In VBA ( see http://stackoverflow.com/questions/7618121/excel-vba-change-color-of-certain-characters-in-a-cell) I

Re: [python-win32] Excel Workbooks Exception

2014-01-31 Thread Mark Mordeca
es+mark.mordeca=prosensus...@python.org] On Behalf Of Tim Golden Sent: January-31-14 10:48 AM To: python-win32@python.org Subject: Re: [python-win32] Excel Workbooks Exception On 31/01/2014 15:08, Mark Mordeca wrote: > I sometimes get a random exception when trying to open an Excel file. > It

Re: [python-win32] Excel Workbooks Exception

2014-01-31 Thread Tim Golden
On 31/01/2014 15:08, Mark Mordeca wrote: > I sometimes get a random exception when trying to open an Excel file. > It is not consistent. I will get the exception, and then try it > again and it will work fine. > xl=win32com.client.DispatchEx("Excel.Application") > > book=xl.Workbooks.Open(self.

[python-win32] Excel Workbooks Exception

2014-01-31 Thread Mark Mordeca
Hello, I sometimes get a random exception when trying to open an Excel file. It is not consistent. I will get the exception, and then try it again and it will work fine. Simple two lines of code: xl=win32com.client.DispatchEx("Excel.Application") book=xl.Workbooks.Open(self.__filename,

Re: [python-win32] Excel + pyinstaller: missing a constant: xlTopToBottom

2013-04-29 Thread Mark Hammond
On 30/04/2013 2:21 AM, Niemann, Hartmut wrote: Hello! The following snippet from win32com.client import constants as xl_constants wbook.ActiveSheet.Range('A3:N' + str(row + 1)).Sort( Key1 = wbook.ActiveSheet.Range('B3'), Orientation = xl_constants.xlTopToBottom, DataOption1 = xl_constant

[python-win32] Excel + pyinstaller: missing a constant: xlTopToBottom

2013-04-29 Thread Niemann, Hartmut
Hello! The following snippet from win32com.client import constants as xl_constants wbook.ActiveSheet.Range('A3:N' + str(row + 1)).Sort( Key1 = wbook.ActiveSheet.Range('B3'), Orientation = xl_constants.xlTopToBottom, DataOption1 = xl_constants.xlSortTextAsNumbers

Re: [python-win32] Excel graphs and saving excel workbook .xls

2011-12-08 Thread Rod Person
On Thu, 8 Dec 2011 09:34:36 +0200 Rikus de Milander wrote: > Hey, > I am currently working on a python script to fetch data from a > database and populate a excel sheet and draw some graphs. Currently I > have only been able to generate a scatter graph with chart.ChartType > = constants.xlXYScat

[python-win32] Excel graphs and saving excel workbook .xls

2011-12-07 Thread Rikus de Milander
Hey, I am currently working on a python script to fetch data from a database and populate a excel sheet and draw some graphs. Currently I have only been able to generate a scatter graph with chart.ChartType = constants.xlXYScatter . Is there a way that one can set the position of the graph on the

[python-win32] Excel worksheet range, Text property

2011-08-09 Thread Andrea Gavana
Hi All, I am trying to speed up a bit a new widget I created for wxPython, which uses heavily the COM interface between Python and Excel (it only reads Excel data, no writing). One of the main issues I have found is related to the extraction of the "Text" property from a range of cells. Let's

Re: [python-win32] Excel "NumberFormat" to Python? (!)

2011-08-05 Thread Tim Roberts
Andrea Gavana wrote: > > I was wondering if someone had already tackled the problem of > converting Excel cell NumberFormat to something Python can parse and > actually use. In more detail, what I mean is: once you right-click on > a cell and select "Format Cells" you get a huge list of possibl

[python-win32] Excel "NumberFormat" to Python? (!)

2011-08-05 Thread Andrea Gavana
Hi All, I was wondering if someone had already tackled the problem of converting Excel cell NumberFormat to something Python can parse and actually use. In more detail, what I mean is: once you right-click on a cell and select "Format Cells" you get a huge list of possible formatting options,

Re: [python-win32] Excel "stopped working" after reading in sheet names

2011-06-03 Thread Tim Golden
On 01/06/2011 16:07, Mark Mordeca wrote: Thanks for your reply. I tested this on another box and I did not get the error. I then tried different code that uses COM to manipulate Excel on my machine which I know works and has worked in the past and I ended up getting the error with that code. S

Re: [python-win32] Excel "stopped working" after reading in sheet names

2011-06-01 Thread Mark Mordeca
To: Mark Mordeca Cc: python-win32@python.org Subject: Re: [python-win32] Excel "stopped working" after reading in sheet names On 31/05/2011 6:09 PM, Tim Golden wrote: > On 30/05/2011 21:26, Mark Mordeca wrote: >> Greetings, >> >> I would appreciate any help I could get

Re: [python-win32] Excel "stopped working" after reading in sheet names

2011-05-31 Thread Mark Hammond
On 31/05/2011 6:09 PM, Tim Golden wrote: On 30/05/2011 21:26, Mark Mordeca wrote: Greetings, I would appreciate any help I could get with the following problem. 30% of the time after running the following code to get the sheet names out of an excel file, I will receive a windows error saying th

Re: [python-win32] Excel "stopped working" after reading in sheet names

2011-05-31 Thread Mark Mordeca
1 11:38 AM Cc: python-win32@python.org Subject: Re: [python-win32] Excel "stopped working" after reading in sheet names On 31/05/2011 16:26, Mark Mordeca wrote: > Thanks for your reply Tim. > If this is true, I hope to get some advice on how to correct the problem. ... Just a cou

Re: [python-win32] Excel "stopped working" after reading in sheet names

2011-05-31 Thread Tim Golden
On 31/05/2011 16:26, Mark Mordeca wrote: Thanks for your reply Tim. If this is true, I hope to get some advice on how to correct the problem. ... Just a couple of quick answers, because I'm dashing off. One is that we have code which uses the technique you're demonstrating to *write* Excel

Re: [python-win32] Excel "stopped working" after reading in sheet names

2011-05-31 Thread Mark Mordeca
ppreciated. Mark -Original Message- From: python-win32-bounces+mark.mordeca=prosensus...@python.org [mailto:python-win32-bounces+mark.mordeca=prosensus...@python.org] On Behalf Of Tim Golden Sent: Tuesday, May 31, 2011 4:09 AM To: python-win32@python.org Subject: Re: [python-win32] Excel &q

Re: [python-win32] Excel "stopped working" after reading in sheet names

2011-05-31 Thread Tim Golden
On 30/05/2011 21:26, Mark Mordeca wrote: Greetings, I would appreciate any help I could get with the following problem. 30% of the time after running the following code to get the sheet names out of an excel file, I will receive a windows error saying that “Microsoft Office Excel has stopped wo

[python-win32] Excel "stopped working" after reading in sheet names

2011-05-30 Thread Mark Mordeca
Greetings, I would appreciate any help I could get with the following problem. 30% of the time after running the following code to get the sheet names out of an excel file, I will receive a windows error saying that “Microsoft Office Excel has stopped working”. Code: xl=win32com.client.Disp

Re: [python-win32] Excel Calculation - Check when it's done

2009-08-27 Thread Bilokon, Paul
: [python-win32] Excel Calculation - Check when it's done Bilokon, Paul wrote: > Thanks so much! > > Is there anything like a "global" Worksheet_Calculate, which would get hit > when the entire worksheet calculation is done? > Not that I am aware of, but you probably wan

Re: [python-win32] Excel Calculation - Check when it's done

2009-08-26 Thread Tim Roberts
Bilokon, Paul wrote: > Thanks so much! > > Is there anything like a "global" Worksheet_Calculate, which would get hit > when the entire worksheet calculation is done? > Not that I am aware of, but you probably want to experiment with it to see if it does what you need. > Also, are there many

Re: [python-win32] Excel Calculation - Check when it's done

2009-08-26 Thread Bilokon, Paul
lokon=citi@python.org [mailto:python-win32-bounces+paul.bilokon=citi@python.org] On Behalf Of Tim Roberts Sent: 25 August 2009 18:13 To: Python-Win32 List Subject: Re: [python-win32] Excel Calculation - Check when it's done Bilokon, Paul wrote: > > My apologies as this question is

Re: [python-win32] Excel Calculation - Check when it's done

2009-08-25 Thread Tim Roberts
Bilokon, Paul wrote: > > My apologies as this question is indeed Excel specific though it's > wide applicability probably merits inclusion here. > > Is there any way to determine when a calculation is done in Excel from > Python over COM, without busy-waiting? > > Does anyone have any example

[python-win32] Excel Calculation - Check when it's done

2009-08-25 Thread Bilokon, Paul
Hi, My apologies as this question is indeed Excel specific though it's wide applicability probably merits inclusion here. Is there any way to determine when a calculation is done in Excel from Python over COM, without busy-waiting? Does anyone have any examples? Many thanks, Paul

[python-win32] Excel -- Range() not working

2009-03-31 Thread Gerald Reeder
Hello, I'm trying to get values from a non-contiguous range, specifically "E5:E10,E35" Range("E5:E10,E35").Value -- only returns the values for "E5:E10", ignoring "E35" Range("E5:E10,E35").Address -- however returns "E5:E10,E35" Range("E5:E10,E35").Count -- returns 7, which is correct I'm early

Re: [python-win32] Excel Document

2008-07-25 Thread Tony Cappellini
Message: 1 Date: Fri, 25 Jul 2008 12:52:04 +0200 From: Michiel Overtoom <[EMAIL PROTECTED]> Subject: Re: [python-win32] Excel Document To: python-win32@python.org Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="us-ascii" Sina wrote... >To read

Re: [python-win32] Excel Document

2008-07-25 Thread Michiel Overtoom
Sina wrote... >To read the contents of an excel spreadsheet. In one case I am trying to >read the value of the cell rather than its contents. i.e. if I have a >hyperlink called "Document" or "Procedure" which is a hyperlink to >http://intranet/foo.pdf then this script will return "Document" or "Li

[python-win32] Excel Document

2008-07-24 Thread Sina S
Hi guys, I have been using this module http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440661 To read the contents of an excel spreadsheet. In one case I am trying to read the value of the cell rather than its contents. i.e. if I have a hyperlink called "Document" or "Procedure" which is

Re: [python-win32] Excel - accessing a control's properties in an event

2008-05-13 Thread Sriram Sundararajan
> Sriram Sundararajan wrote: > >I have a question on the excelAddin.py sample in the win32com\demos folder. > > > > We create a Tool Bar, add a button to it, > > btnMyButton = cbcMyBar.Controls.Add(Type=constants.msoControlButton, > > Parameter="Greetings") > > > > 'register' the button wit

[python-win32] Excel - accessing a control's properties in an event

2008-05-12 Thread Roger Upole
Sriram Sundararajan wrote: I have a question on the excelAddin.py sample in the win32com\demos folder. We create a Tool Bar, add a button to it, btnMyButton = cbcMyBar.Controls.Add(Type=constants.msoControlButton, Parameter="Greetings") 'register' the button with the ButtonEvent class, btnMyBu

[python-win32] Excel - accessing a control's properties in an event handler

2008-05-09 Thread Sriram Sundararajan
I have a question on the excelAddin.py sample in the win32com\demos folder. We create a Tool Bar, add a button to it, btnMyButton = cbcMyBar.Controls.Add(Type=constants.msoControlButton, Parameter="Greetings") 'register' the button with the ButtonEvent class, btnMyButton=self.toolbarButton = Disp

[python-win32] Excel columnwise writing

2008-02-17 Thread Nicholas
I am writing to arrays to excel. If I write row-wise everything works well. app.Range('d4:f4').Value = [2,3,4] However if I try to assign column wise everything goes wrong app.Range('d4:d6').Value = [2,3,4] I know I can rearrage things like [[i] for i in [2,3,4]] but it does not seem terribly

Re: [python-win32] Excel Cells method/property and introspectionquestions

2007-06-25 Thread Mark Hammond
> >>> from win32com.client import Dispatch > >>> xlApp = Dispatch("Excel.Application") > >>> actvSht = xlApp.ActiveSheet > >>> actvSht.Cells(1,1).Value > Traceback (most recent call last): > File "", line 1, in ? > File > "c:\python24\lib\site-packages\win32com\gen_py\00020813--0 > 000-C000

[python-win32] Excel Cells method/property and introspection questions

2007-06-22 Thread Thomas Crawley
Hi, I have been working thru the 'Python Programming on Win32' book by M. Hammond in an attempt to get up to speed on Python COM programming. I am trying to do some simple output to Excel from a Turbogears application. I am using Microsoft Excel 2003. I have run into an issue using the Cells met

Re: [python-win32] Excel calls failing

2007-05-04 Thread Tim Golden
Carlos Izquierdo wrote: > The error is almost always on the lines of: "bool object is not > callable". Feel free to knock this suggestion on the head straightaway, but an error of this type will often come down to the fact that -- somewhere in the code -- you've bound a name which is origi

[python-win32] Excel calls failing

2007-05-03 Thread Carlos Izquierdo
Hi, I'm fairly new to Python COM development and I'm having trouble automating Microsoft Excel. I have the following piece of code: d = win32com.client.Dispatch('Excel.Application') d.Visible = 1 dw = d.Workbooks.Open('c:\\datos.xls') dw.Sheets(1

Re: [python-win32] excel xla runautomacros

2007-04-25 Thread Tim Roberts
Hussain Jiwani wrote: > Following is a snippet of code that I have been using to figure out if > an addin in installed. > > xlApp = win32com.client.dynamic.Dispatch('Excel.Application') > xlApp.DisplayAlerts = 0 > xlApp.Interactive = 1 > if xlApp.Application.Addins.C

Re: [python-win32] excel xla runautomacros

2007-04-25 Thread Hussain Jiwani
xlApp.quit return xlApp.Application.Addins(lnAddins).Installed = 0 xlApp.Application.Addins(lnAddins).Installed = 1 Hussain -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tim Roberts Sent: Wednesday, April 25, 2007 12:

Re: [python-win32] excel xla runautomacros

2007-04-25 Thread Tim Roberts
mjohnson wrote: > I am having a problem with an excel add-in which is installed via > xlApp.Workbooks.Open("C:/Program > Files/Program/XLOF32.xla").RunAutoMacros(1) > > I can then add the add-in and install it via > xlApp.AddIns.Add ("C:/Program Files/Program/XLOF32.xla",True) > xlApp.AddIns.Item(I

[python-win32] excel xla runautomacros

2007-04-25 Thread mjohnson
I am having a problem with an excel add-in which is installed via xlApp.Workbooks.Open("C:/Program Files/Program/XLOF32.xla").RunAutoMacros(1) I can then add the add-in and install it via xlApp.AddIns.Add ("C:/Program Files/Program/XLOF32.xla",True) xlApp.AddIns.Item(Index='Excel Functions').Inst

Re: [python-win32] Excel COM problem

2007-02-12 Thread Graham Bloice
Andrea Gavana wrote: > Hi Roger, > > On 2/10/07, Roger Upole wrote: >> "Andrea Gavana" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >>> Hi All, >>> >>>I have a very simple python script that tries to put a rectangular >>> shape in a worksheet and then add some text inside that s

Re: [python-win32] Excel COM problem

2007-02-12 Thread Andrea Gavana
Hi Roger, On 2/10/07, Roger Upole wrote: > "Andrea Gavana" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Hi All, > > > >I have a very simple python script that tries to put a rectangular > > shape in a worksheet and then add some text inside that shape. The > > main problem,

[python-win32] Excel COM problem

2007-02-09 Thread Roger Upole
"Andrea Gavana" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi All, > >I have a very simple python script that tries to put a rectangular > shape in a worksheet and then add some text inside that shape. The > main problem, is that as usual Excel doesn't like input strings lon

[python-win32] Excel COM problem

2007-02-08 Thread Andrea Gavana
Hi All, I have a very simple python script that tries to put a rectangular shape in a worksheet and then add some text inside that shape. The main problem, is that as usual Excel doesn't like input strings longer than 200 and something characters. So, By just recording a macro in Excel, I trie

Re: [python-win32] Excel sort error with Python 2.2.3 & earlybinding

2006-12-19 Thread Charlton, Craig A Ctr SMC/ISA
I ran my test with the 'optional' arguments defined as pythoncom.Missing and it does work now. Previously my code was working under a very old Python 1.5.2 where the 'defaultNamedNotOptArg' was defined as pythoncom.Missing in the .py file generated for the Excel 11.0 Object Library. Evidently the

[python-win32] Excel sort error with Python 2.2.3 & early binding

2006-12-19 Thread Charlton, Craig A Ctr SMC/ISA
I am using Python 2.2.3 with Pywin32-210.win32-py2.2 The following Python sequence works fine when using the 'late binding' method. import win32com.client.dynamic import types xlApp = win32com.client.Dispatch("Excel.Application") xlBook = xlApp.Workbooks.Open( 'C:\\TestExcel.xls' ) sheet = xlBook.

Re: [python-win32] Excel COM-object for cursor position UPDATE

2006-11-24 Thread James Matthews
Thanks helped me i was just working on that also! On 11/23/06, Bob Gailer <[EMAIL PROTECTED]> wrote: Please reply to the list as well as me. Others learn and sometimes offer help. Rikard Bosnjakovic wrote: > > I'm an utter novice of COM/DOM and I really don't have much knowledge > about it. I k

Re: [python-win32] Excel COM-object for cursor position UPDATE

2006-11-23 Thread Bob Gailer
Please reply to the list as well as me. Others learn and sometimes offer help. Rikard Bosnjakovic wrote: > > I'm an utter novice of COM/DOM and I really don't have much knowledge > about it. I know how to launch Word/Excel from Python by using > Dispatch("Excel.Application"), but that's about it.

Re: [python-win32] Excel COM-object for cursor position UPDATE

2006-11-22 Thread Bob Gailer
Rikard Bosnjakovic wrote: > I am going to add data row wise to Excel. Doing it manually, it would > be like this: > > TAB TAB RETURN > TAB TAB RETURN > > The TAB makes the cursor go to the next cell in the row, and the > RETURN makes the cursor go to the next row, in the same column as the >

Re: [python-win32] Excel COM-object for cursor position

2006-11-22 Thread Bob Gailer
Rikard Bosnjakovic wrote: > I am going to add data row wise to Excel. Doing it manually, it would > be like this: > > TAB TAB RETURN > TAB TAB RETURN > > The TAB makes the cursor go to the next cell in the row, and the > RETURN makes the cursor go to the next row, in the same column as the >

[python-win32] Excel COM-object for cursor position

2006-11-22 Thread Rikard Bosnjakovic
I am going to add data row wise to Excel. Doing it manually, it would be like this: TAB TAB RETURN TAB TAB RETURN The TAB makes the cursor go to the next cell in the row, and the RETURN makes the cursor go to the next row, in the same column as the first cell. Now I need to do this in Pyth

Re: [python-win32] Excel and OLEObjects

2006-10-31 Thread Mark Norley
thon-win32@python.org Subject: Re: [python-win32] Excel and OLEObjects Mark Norley wrote: > Hello > > I'm trying to insert an object into an Excel sheet with the following code: > > import win32com.client > xlapp = win32com.client.Dispatch("Excel.Application"

Re: [python-win32] Excel and OLEObjects

2006-10-30 Thread Bob Gailer
Mark Norley wrote: > Hello > > I'm trying to insert an object into an Excel sheet with the following code: > > import win32com.client > xlapp = win32com.client.Dispatch("Excel.Application") > xlapp.Visible = 1 > xlapp.Workbooks.Add() > xlapp.ActiveSheet.OLEObjects.Add(FileName = "C:\\mytext.tx"', L

[python-win32] Excel and OLEObjects

2006-10-30 Thread Mark Norley
Hello I'm trying to insert an object into an Excel sheet with the following code: import win32com.client xlapp = win32com.client.Dispatch("Excel.Application") xlapp.Visible = 1 xlapp.Workbooks.Add() xlapp.ActiveSheet.OLEObjects.Add(FileName = "C:\\mytext.tx"', Link=False, DisplayAsIcon=False).Sel

Re: [python-win32] Excel win32com newbie question

2006-10-06 Thread Jim Steil
: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tim Roberts Sent: Friday, October 06, 2006 12:27 PM To: 'Python-Win32 List' Subject: Re: [python-win32] Excel win32com newbie question Jim Steil wrote: >Thanks for the response! I tried your suggestion with the follo

Re: [python-win32] Excel win32com newbie question

2006-10-06 Thread Tim Roberts
Jim Steil wrote: >Thanks for the response! I tried your suggestion with the following >results > > > import win32com.client x = win32com.client.gencache.EnsureDispatch("Excel.Application") >Traceback (most recent call last): > File "", line 1, in ? > File "C:\Pyt

Re: [python-win32] Excel win32com newbie question

2006-10-06 Thread Jim Steil
thon-win32@python.org Subject: Re: [python-win32] Excel win32com newbie question Python 2.4.1 Pywin23 2.10 I'm in the process of upgrading my python to 2.4.3, will send a follow-up after I'm done testing. Thanks! -Jim -Original Message- From: John Machin [mailto:[EM

Re: [python-win32] Excel win32com newbie question

2006-10-06 Thread Jim Steil
Oops, obvious typo on the pywin23 below. Should be pywin32. -Jim -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jim Steil Sent: Friday, October 06, 2006 11:59 AM To: 'John Machin' Cc: python-win32@python.org Subject: Re: [python-wi

Re: [python-win32] Excel win32com newbie question

2006-10-06 Thread Jim Steil
PROTECTED] Sent: Friday, October 06, 2006 10:52 AM To: Jim Steil Cc: python-win32@python.org Subject: Re: [python-win32] Excel win32com newbie question On 6/10/2006 11:34 PM, Jim Steil wrote: > Thanks for your response too! Unfortunately, I must have something messed > up here because

Re: [python-win32] Excel win32com newbie question

2006-10-06 Thread John Machin
On 6/10/2006 11:34 PM, Jim Steil wrote: > Thanks for your response too! Unfortunately, I must have something messed > up here because this didn't work either. > from win32com.client import Dispatch, constants print getattr(constants, 'xlHAlignRight', 'Bt!') > Bt! app = Disp

Re: [python-win32] Excel win32com newbie question

2006-10-06 Thread Jim Steil
Machin [mailto:[EMAIL PROTECTED] Sent: Thursday, October 05, 2006 6:04 PM To: Jim Steil Cc: python-win32@python.org Subject: Re: [python-win32] Excel win32com newbie question On 6/10/2006 7:16 AM, Jim Steil wrote: > I've been working this week building some Excel spreadsheets using > Py

Re: [python-win32] Excel win32com newbie question

2006-10-06 Thread Jim Steil
, ^ SyntaxError: invalid syntax >>> Any ideas from here? -Jim -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tim Roberts Sent: Thursday, October 05, 2006 6:06 PM To: Python-W

Re: [python-win32] Excel win32com newbie question

2006-10-05 Thread Tim Roberts
Jim Steil wrote: > I’ve been working this week building some Excel spreadsheets using > Python and win32com. ... > > Possibly my biggest problem is that I can’t get my machine to give me > the Excel constants. Here is the code I’m doing to try to test the > constants and the error I’m getting back

Re: [python-win32] Excel win32com newbie question

2006-10-05 Thread John Machin
On 6/10/2006 7:16 AM, Jim Steil wrote: > I’ve been working this week building some Excel spreadsheets using > Python and win32com. I am not having any trouble getting my sheets > built with the proper data in the proper cells, but I’m having a heck of > a time trying to find out how I can forma

[python-win32] Excel win32com newbie question

2006-10-05 Thread Jim Steil
I’ve been working this week building some Excel spreadsheets using Python and win32com.  I am not having any trouble getting my sheets built with the proper data in the proper cells, but I’m having a heck of a time trying to find out how I can format my cells to make it look nicer.  I want

Re: [python-win32] Excel corrupted display problem

2006-08-17 Thread Metz, Bobby W, WWCS
EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Bob Gailer Sent: Thursday, August 17, 2006 4:37 PM To: [EMAIL PROTECTED] Cc: python-win32@python.org Subject: Re: [python-win32] Excel corrupted display problem [EMAIL PROTECTED] wrote: > Hi list, > > I have a Python script that pops

Re: [python-win32] Excel corrupted display problem

2006-08-17 Thread Bob Gailer
[EMAIL PROTECTED] wrote: > Hi list, > > I have a Python script that pops up Excel, fill it, > and then continue. If the user clicks on my Python > side to close Excel (via a call to the Quit() > function), then I can reopen it later via another > dispatch call and so forth. > > However, if the us

[python-win32] Excel corrupted display problem

2006-08-17 Thread kc106_2005-pywin32
Hi list, I have a Python script that pops up Excel, fill it, and then continue. If the user clicks on my Python side to close Excel (via a call to the Quit() function), then I can reopen it later via another dispatch call and so forth. However, if the user close Excel from the Excel side, next

[python-win32] Excel Application

2006-02-20 Thread yeswanty devi
Hello all,  if we have number of excel sheets in a workbook.can we access a select sheet in the workbook. when i try to acces it always goes to the last sheet.   thanks,       Yahoo! Autos. Looking for a sweet ride? Get pricing, reviews, & more on new and used cars.___

Re: [python-win32] Excel using python

2006-02-20 Thread p.asselman
2006/02/20 ma PM 12:15:49 CET > aan: > onderwerp: Re: [python-win32] Excel using python > > [John Machin] > > | > OK, given the workbook created in my previous post... > > [ ... snip more code ...] > > | OK, great, Tim, we're almost there :-) > | "when i

Re: [python-win32] Excel using python

2006-02-20 Thread John Machin
On 20/02/2006 10:37 PM, Tim Golden wrote: > | From: John Machin [mailto:[EMAIL PROTECTED] > | > | Tim, that's fantastic. Hold out your hand for the elephant stamp :-) > > Must be an American thing? (Obligatory Monty Python > reference: I'm sorry, old man, I don't quite follow your > banter!) >

Re: [python-win32] Excel using python

2006-02-20 Thread Tim Golden
| From: John Machin [mailto:[EMAIL PROTECTED] | | Tim, that's fantastic. Hold out your hand for the elephant stamp :-) Must be an American thing? (Obligatory Monty Python reference: I'm sorry, old man, I don't quite follow your banter!) | ... apart from moderate banter, we haven't got off his |

Re: [python-win32] Excel using python

2006-02-20 Thread John Machin
On 20/02/2006 10:15 PM, Tim Golden wrote: > [John Machin] > > | > OK, given the workbook created in my previous post... > > [ ... snip more code ...] > > | OK, great, Tim, we're almost there :-) > | "when i try to acces it always goes to the last sheet." ... > | looks like > | the OP wants th

Re: [python-win32] Excel using python

2006-02-20 Thread Tim Golden
[John Machin] | > OK, given the workbook created in my previous post... [ ... snip more code ...] | OK, great, Tim, we're almost there :-) | "when i try to acces it always goes to the last sheet." ... | looks like | the OP wants the default sheet to point to some sheet other than the | last

Re: [python-win32] Excel using python

2006-02-20 Thread John Machin
On 20/02/2006 8:02 PM, Tim Golden wrote: > [John Machin] > | > | On 20/02/2006 7:46 PM, Tim Golden wrote: > | > [yeswanty devi] > | > > | > | Hello all, > | > | if we have number of excel sheets in a workbook.can > | > | we access a selected sheet in the workbook. when i try to > | > |

Re: [python-win32] Excel using python

2006-02-20 Thread Tim Golden
[John Machin] | | On 20/02/2006 7:46 PM, Tim Golden wrote: | > [yeswanty devi] | > | > | Hello all, | > | if we have number of excel sheets in a workbook.can | > | we access a selected sheet in the workbook. when i try to | > | acces it always goes to the last sheet. | > | > I assume

Re: [python-win32] Excel using python

2006-02-20 Thread John Machin
On 20/02/2006 7:46 PM, Tim Golden wrote: > [yeswanty devi] > > | Hello all, > | if we have number of excel sheets in a workbook.can > | we access a selected sheet in the workbook. when i try to > | acces it always goes to the last sheet. > > I assume this is the kind of thing you want

Re: [python-win32] Excel using python

2006-02-20 Thread Tim Golden
[yeswanty devi] | Hello all, | if we have number of excel sheets in a workbook.can | we access a selected sheet in the workbook. when i try to | acces it always goes to the last sheet. I assume this is the kind of thing you want: (somewhat exaggerated example, but ...) import os imp

[python-win32] Excel using python

2006-02-19 Thread yeswanty devi
Hello all,  if we have number of excel sheets in a workbook.can we access a selected sheet in the workbook. when i try to acces it always goes to the last sheet.   thanks, Yahoo! Mail Use Photomail to share photos without annoying attachments.__

Re: [python-win32] Excel advanced find

2006-02-15 Thread Dan Glassman
Tim Golden wrote: > [EMAIL PROTECTED] > > | Hello all, > | > | I'm having some trouble on the find function in Excel. A > | simple Find statement works fine, but as soon as I want to > | use an advanced option (xlByColumns) I get an error. > | > > [... snip ...] > > | findcell = > | xlApp.A

Re: [python-win32] Excel advanced find

2006-02-15 Thread Tim Golden
[EMAIL PROTECTED] | Hello all, | | I'm having some trouble on the find function in Excel. A | simple Find statement works fine, but as soon as I want to | use an advanced option (xlByColumns) I get an error. | [... snip ...] | findcell = | xlApp.ActiveSheet.UsedRange.Find('FXN3',None,consta

[python-win32] Excel advanced find

2006-02-15 Thread p.asselman
Hello all, I'm having some trouble on the find function in Excel. A simple Find statement works fine, but as soon as I want to use an advanced option (xlByColumns) I get an error. This is my program: #!/usr/bin/python from win32com.client import Dispatch from win32com.client import constants x

Re: [python-win32] Excel

2006-01-10 Thread bob
At 01:10 PM 1/10/2006, John Machin wrote: >bob wrote: > > At 11:16 AM 1/10/2006, John Machin wrote: > > > >> bob wrote: > >> > >>> Viola, it displays 6. Oh alright I meant voila. Mi francios es pocito. > >> > >> > >> :-) > >> Cello, it displays 7. > >> (-: > > > > Version difference? I'm using Ex

Re: [python-win32] Excel

2006-01-10 Thread John Machin
bob wrote: > At 11:16 AM 1/10/2006, John Machin wrote: > >> bob wrote: >> >>> Viola, it displays 6. >> >> >> :-) >> Cello, it displays 7. >> (-: > > Version difference? I'm using Excel 2000. and I get xlcsv = 6! But it > should stay the same! > > You can also open the object browser (F2) within

Re: [python-win32] Excel

2006-01-10 Thread Stefan Elwesthal
Thank you all for the assistance! That file were saved nice and easy and I can continue struggling with my quest to get out of all C# code. Not that i dislike C#, but the right tool to do the right job ;-) Again, huge thanks! Stefan -- ___ Check o

Re: [python-win32] Excel

2006-01-10 Thread Tim Roberts
On Wed, 11 Jan 2006 00:12:28 +0800, "Stefan Elwesthal" <[EMAIL PROTECTED]> wrote: > > I have to ask, cause two days later I'm starting to get annoyed ;-) > > How could I use PythonCOM and save my re-worked Excel file as an xlCSV > file? All I get is > "SaveAs method in Worksheet class failed". >

Re: [python-win32] Excel

2006-01-10 Thread John Machin
Stefan Elwesthal wrote: > Hi all! > > I have to ask, cause two days later I'm starting to get annoyed ;-) > > How could I use PythonCOM and save my re-worked Excel file as an xlCSV file? > All I get is > "SaveAs method in Worksheet class failed". > > Is something wrong with this line? Yes. Two

  1   2   >