473,609 Members | 2,017 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

win32com error

p {margin: 0px}

Hi all,

 

I have the following code snippet:

 

  &nb sp;   myRange = self.xlSheet.Ce lls
  &nb sp;   # delete conditional formatings
  &nb sp;   myRange.FormatC onditions.Delet e()
  &nb sp;   # set formula1 for conditional formating
  &nb sp;   formula1 = """=OR($B1="bar ", $B1="foo")"""
  &nb sp;   myRange.FormatC onditions.Add(w in32com.client. constants.xlExp ression, '', formula1, '')
  &nb sp;   myRange.FormatC onditions.Item( 1).Interior.Col orIndex = 42
  &nb sp;   myRange.FormatC onditions.Item( 1).Font.Bold&nb sp;  = 1
  &nb sp;   myRange.FormatC onditions.Item( 1).Font.Italic = 0

 

On my computer the script works fine.

When I run it on an other machine (same OS, same Excel version) the script raises the following exception:

 

Traceback (most recent call last):
  File "P:\public\cke\ language_pack_a nalyzer\languag e_pack_analyzer .py", line 15
9, in ?
  &nb sp; ExcelFileGenera tor(excelFileNa me, xmlFileName, xslFileName1, xslFileName2)
  File "P:\public\cke\ language_pack_a nalyzer\languag e_pack_analyzer .py", line 40
, in __init__
  &nb sp; self.pasteStrin gInExcel(import String)
  File "P:\public\cke\ language_pack_a nalyzer\languag e_pack_analyzer .py", line 12
4, in pasteStringInEx cel
  &nb sp; self.setColorin g()
  File "P:\public\cke\ language_pack_a nalyzer\languag e_pack_analyzer .py", line 14
0, in setColoring
  &nb sp; myRange.FormatC onditions.Add(w in32com.client. constants.xlExp ression, '', for
mula1, '')
  ! File "E:\Python22\Li b\site-packages\win32c om\gen_py\00020 813-0000-0000 -C000-00
0000000046x0x1x 3.py", line 6052, in Add
  &nb sp; ret = self._oleobj_.I nvokeTypes(0xb5 , LCID, 1, (9, 0), ((3, 1), (12, 17), (1
2, 17), (12, 17)),2, Operator, Formula1, Formula2)
pywintypes.com_ error: (-2147352567, 'Exception occurred.', (0, None, None, None,
 0, -2147024809), None)


Any help would be appreciated

 

Regards

 

Oliver

_______________ _______________ _______________ _______________ _______________ ___
Design-Mails, Smileys, Bilder - einfach schoenere E-Mails schreiben
WEB.DE FreeMail Deutschlands beste E-Mail - http://f.web.de/?mc=021143
Jul 18 '05 #1
0 1761

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5180
by: Justin Stockton | last post by:
I recently upgraded from ActivePython 2.2.2 to ActivePython 2.3.2 and I'm running into an issue importing the win32com.client module. Before installing the new version, I made sure to properly remove old version (as well as the mx libraries I had installed). I then installed the new version as a user with the Administrator role. I know I'm technically not supposed to install to a directory with a space in the name, but it worked fine for...
1
1788
by: Cristian Hasbun from Chile | last post by:
I need a win32com guru please... i'm not python expert, but i understand mi trouble... Requirements: Hook EyesWeb 3.2.0 (http://www.eyesweb.org) COM Module with Python 2.0.1 i used win32com libraries and generate an early binding for module (using prog_id)
0
4081
by: goermezer | last post by:
Hello, I have some problems to automate a CAD (computer aided design) Software called CATIA V5 from Dassault Systemes. CATIA V5 has a builtin VB-Editor like Word, Excel, … and registers itself as a COM-server. With VB one can automate everything in CATIA V5 with a lot of registered Object Libraries. A VB example:
0
2271
by: mb3242 | last post by:
Hello, I'm trying to use win32com to call a method in a COM object. I'm having a problem with Python choosing the wrong type when wrapping up lists into VARIANTs. The function I'm trying to call in C++ looks like this: HRESULT write( VARIANT * len, VARIANT * saData, VARIANT * result); Where saData contains a SafeArray of bytes and len is its length. The function returns any error information in result.
1
9140
by: g.franzkowiak | last post by:
I'm trying to use a proprietary windows software with COM and win32com. The result is everytime the error message com_error: (-2147418113, 'Catastrophic failure', None, None) I've read this in some e-mails, but can't find the solution and I have not enough experience with Windows and COM. Can anybody help ?
2
3289
by: ago | last post by:
I am trying to make the win32com HelloWorld server work with a VBA client but I get: Run-time error '-2147467259(80004005)': Automation error Unspecified error I googled for the error but the suggested solutions (commenting out _reg_class_spec_ and putting the server on the python path) do not seem to make any difference (to be precise, unless I comment out
4
6868
by: mirandacascade | last post by:
O/S : Win2K vsn of Python: 2.4 Hoping to find information that provide information about error messages being encountered. Pythonwin session: Traceback (most recent call last): File "<interactive input>", line 1, in ?
1
3023
by: SPJ | last post by:
Sorry, forgot to mention Subject in my earlier post, hence reposting. ------------ I am writing a script which need's to convert an excel file to csv (text) format. For that I am using the following code: excel = win32com.client.Dispatch("Excel.Application","Quit") workbook = excel.Workbooks.Open(xlsfile) workbook.SaveAs(csvfile, FileFormat=24) # 24 represents xlCSVMSDOS workbook.Close(False) excel.Quit()
11
7691
by: Bill Davy | last post by:
I am trying to edit Contacts in Outlook. This is so I can transfer numbers from my address book which is an Excel spreadsheet to my mobile phone. I came across the following snippet of code which enabled me to the contacts at least list. I had to root around to discover CdoDefaultFolderContacts (though it was guessable; how could I enumerate win32com.client.constants?). I now want to work through the Contacts in Outlook patching in...
2
10474
by: RyanN | last post by:
Greetings, I'm trying to get DispatchWithEvents() to work with HyperAccess (terminal program) without much success. I've done a bunch of searching and found some examples using IE: This works but doesn't handle the "Event Driven Functions": haObj = win32com.client.Dispatch(r"HAWin32") And so does this Internet Explorer Example:
0
8077
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8573
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8543
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8223
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8406
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5511
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4089
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1673
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.