win32com error

Discussion in 'Python' started by Oliver Emrich, Aug 7, 2003.

  1. 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
    Oliver Emrich, Aug 7, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark Hahn
    Replies:
    2
    Views:
    1,144
    News M Claveau /Hamster-P
    Sep 8, 2003
  2. Math
    Replies:
    0
    Views:
    319
  3. Math
    Replies:
    0
    Views:
    327
  4. ago

    win32com: error 80004005

    ago, Mar 27, 2006, in forum: Python
    Replies:
    2
    Views:
    2,080
    Roger Upole
    Mar 30, 2006
  5. Ransom

    occasional win32com error

    Ransom, Jun 15, 2006, in forum: Python
    Replies:
    1
    Views:
    1,012
    Roger Upole
    Jun 23, 2006
Loading...

Share This Page