win32com

Working with multiple excel workbooks in python

Using win32com, I have two workbooks open. How do you know which one is active? How do you change which one is active? How can you close one and not the other? (not Application.Quit()) ...

Python win32com opening Excel with Bloomberg plugin

I'm trying to automate construction of an Excel 2007 spreadsheet that uses the Bloomberg plugin to pull down live prices. The problem is that when I open Excel through win32com the Bloomberg plugin does not load (so all of the formulas end up with "#NAME?" errors). Manually uninstalling and reinstalling the plugin works, but copying the...

python win32com EXCEL data input error

Welcome, I'm exporting results of my script into Excel spreadsheet. Everything works fine, I put big sets of data into SpreadSheet, but sometimes an error occurs: File "C:\Python26\lib\site-packages\win32com\client\dynamic.py", line 550, in __setattr__ self._oleobj_.Invoke(entry.dispid, 0, invoke_type, 0, v...

Python win32com - Automating Word - How to replace text in a text box?

I'm trying to automate word to replace text in a word document using Python. (I'm on word 2003 if that matters and Python 2.4) The first part of my replace method below works on everything except text in text boxes. The text just doesn't get selected. I notice when I go into Word manually and hit ctrl-A all of the text gets selected ...

Accessing unregistered COM objects from pythonvia a registered TLB

I have three pieces of code that i'm working with at the moment: A closed source application (Main.exe) A closed source VB COM object implemented as a dll (comobj.dll) Code that I am developing in Python comobj.dll hosts a COM object (lets say, 'MainInteract') that I would like to use from Python. I can already use this object perfec...

How to get the Last Active Date of a Process?

Hi all, I have an assignment were in I have to print the last active date of the process using a COM In Proc Server in C++. I tried doing that with getProcessTimes() function, but that gives me an access violation error. First of all, I want to know if there is anyother command that gives the last active date of the process.. Second wh...

iTunes API for python scripting

Hello everybody, I'm trying to develop some scripts for iTunes in python and actually i'm having quite a hard time getting the API information. I'm using the win32com.client module but i would really need to get all the specifications, methods and details. There are a few examples but I need some extra data...... thanks!!! ...

Is there a way to serve up a Python dictionary to a compatible type in Visual Basic 6 using win32com?

Is there a way to serve up a Python dictionary to a compatible type in Visual Basic 6 using win32com? ...

IExplorerBrowser control in python

Hello, I'm try to embed a IExplorerBrowser (Windows Explorer) in a wxpython application but I cannot seem to get the IExplorerBrowser module opened in python I have the CLSID of IExplorerBrowser from the registry but when I try and open it with: from win32com import client client.gencache.GetModuleForCLSID(id) Nothing is returned.....

win32com - Write String values in Excel sheet

I'm using win32com to write some dates that I receive from a database, and my problem is that I'm having values like '01' and in Excel is just '1' - not '01'. Example: b = row[1] # b has the value 01 c = "-"+b+"-" # c has value -01- sheet.Cells(1,1).Value = b # I have in Excel '1' ; I've try with str(b), c - but is the sam...

Python win32com - application installed with both 32bit and 64bit versions

Hi, I am using pythons win32com module to automate Adobe Photoshop. This works fine on some machines (have had issues with it not working on users with limited windows account permissions, but thats another issue). But on machines with both the 32bit and 64bit versions of Photoshop installed, I am getting errors when trying to access c...

Python Visual Basic's CDate equivalent

I used to have this code in Visual Basic: rpt.ParameterFields.GetItemByName("RowDate").AddCurrentValue CDate("2010-03-19") and I cannot figure out into what I have to convert date to make eatable for COM. Any suggestions? ...

provider cannot be found error in python connecting to SQL Server

I'm attempting to connect to a SQL Server database within a Python script. I'm using SQLNCLI as provider on my connection string. from win32com.client import Dispatch connection_string = "Provider=SQLNCLI;server=%s;initial catalog=%s;user id=%s;password=%s"%(server,db_name,user,pwd) dbConn = Dispatch("ADODB.Connection") dbConn.Open( ...