win32com error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Oliver Emrich

    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
Working...