win32com error

O

Oliver Emrich

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.constants.xlExpression, '', formula1, '')
      myRange.FormatConditions.Item(1).Interior.ColorIndex = 42
      myRange.FormatConditions.Item(1).Font.Bold   = 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_pack_analyzer.py", line 15
9, in ?
    ExcelFileGenerator(excelFileName, xmlFileName, xslFileName1, xslFileName2)
  File "P:\public\cke\language_pack_analyzer\language_pack_analyzer.py", line 40
, in __init__
    self.pasteStringInExcel(importString)
  File "P:\public\cke\language_pack_analyzer\language_pack_analyzer.py", line 12
4, in pasteStringInExcel
    self.setColoring()
  File "P:\public\cke\language_pack_analyzer\language_pack_analyzer.py", line 14
0, in setColoring
    myRange.FormatConditions.Add(win32com.client.constants.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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top