Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > win32com error

Reply
Thread Tools

win32com error

 
 
Oliver Emrich
Guest
Posts: n/a
 
      08-07-2003
p {margin: 0px}

Hi all,



 



I have the following code snippet:



 



      myRange = self.xlSheet.Cells
      # delete conditional formatings
      myRange.FormatConditions.Delete()
      # set formula1 for conditional formating
      formula1 = """=OR($B1="bar", $B1="foo")"""
      myRange.FormatConditions.Add(win32com.client.const ants.xlExpression, '', formula1, '')
      myRange.FormatConditions.Item(1).Interior.ColorInd ex = 42
      myRange.FormatConditions.Item(1).Font.Bold &n bsp; = 1
      myRange.FormatConditions.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_analyzer\language_pac k_analyzer.py", line 15
9, in ?
    ExcelFileGenerator(excelFileName, xmlFileName, xslFileName1, xslFileName2)
  File "P:\public\cke\language_pack_analyzer\language_pac k_analyzer.py", line 40
, in __init__
    self.pasteStringInExcel(importString)
  File "P:\public\cke\language_pack_analyzer\language_pac k_analyzer.py", line 12
4, in pasteStringInExcel
    self.setColoring()
  File "P:\public\cke\language_pack_analyzer\language_pac k_analyzer.py", line 14
0, in setColoring
    myRange.FormatConditions.Add(win32com.client.const ants.xlExpression, '', for
mula1, '')
  ! File "E:\Python22\Lib\site-packages\win32com\gen_py\00020813-0000-0000 -C000-00
0000000046x0x1x3.py", line 6052, in Add
    ret = self._oleobj_.InvokeTypes(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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
occasional win32com error Ransom Python 1 06-23-2006 04:34 AM
win32com: error 80004005 ago Python 2 03-30-2006 08:22 AM
Distutils Error while building 'win32com.client' extension Math Python 0 02-26-2006 07:03 PM
Distutils Error while building 'win32com.client' extension Math Python 0 02-26-2006 07:00 PM
win32com: need help with opening mapi session error Mark Hahn Python 2 09-08-2003 07:16 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57