<html><base href="https://freemail.web.de/"/><style>p {margin: 0px}</style><body style='font-size:9pt; font-family:Verdana; font-family: Verdana' ><P>Hi all,</P><P> </P><P>I have the following code snippet:</P><P> </P><P><EM>      myRange = self.xlSheet.Cells<BR>      # delete conditional formatings<BR>      myRange.FormatConditions.Delete()<BR>      # set formula1 for conditional formating<BR>      formula1 = """=OR($B1="bar", $B1="foo")"""<BR>      myRange.FormatConditions.Add(win32com.client.constants.xlExpression, '', formula1, '')<BR>      myRange.FormatConditions.Item(1).Interior.ColorIndex = 42<BR>      myRange.FormatConditions.Item(1).Font.Bold   = 1<BR>      myRange.FormatConditions.Item(1).Font.Italic = 0</EM></P><P> </!
 P><P>On my computer the script works fine.</P><P>When I run it on an other machine (same OS, same Excel version) the script raises the following exception:</P><P> </P><P><EM>Traceback (most recent call last):<BR>  File "P:\public\cke\language_pack_analyzer\language_pack_analyzer.py", line 15<BR>9, in ?<BR>    ExcelFileGenerator(excelFileName, xmlFileName, xslFileName1, xslFileName2)<BR>  File "P:\public\cke\language_pack_analyzer\language_pack_analyzer.py", line 40<BR>, in __init__<BR>    self.pasteStringInExcel(importString)<BR>  File "P:\public\cke\language_pack_analyzer\language_pack_analyzer.py", line 12<BR>4, in pasteStringInExcel<BR>    self.setColoring()<BR>  File "P:\public\cke\language_pack_analyzer\language_pack_analyzer.py", line 14<BR>0, in setColoring<BR><FONT color=#ff0000>    myRange.FormatConditions.Add(win32com.client.constants.xlExpression, '', for<BR>mula1, '')<BR>  !
 File "E:\Python22\Lib\site-packages\win32com\gen_py\00020813-0000-0000
-C000-00<BR><A href="javascript:open_jump_comwin('/ComWin/?telno=0000000046&mc=020022&crypt=XXX&rv_crypt=LW7qckJKxf7suRVxPiT8hDoK%2BgpcBiuh6WR9A03/u1bmXjHeQnNrIlhr5AvXaiqPFou1DmaJq5qDu1LffTbnn0Imqmidmm%2BISuQFUQUxby4Tf3x9oXVd5QCitu6A7YRM1j5oig%3D%3D');">0000000046</A>x0x1x3.py", line 6052, in Add<BR>    ret = self._oleobj_.InvokeTypes(0xb5, LCID, 1, (9, 0), ((3, 1), (12, 17), (1<BR>2, 17), (12, 17)),2, Operator, Formula1, Formula2)<BR>pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, None, None, None,<BR> 0, -2147024809), None)</FONT></EM><BR></P><P>Any help would be appreciated</P><P> </P><P>Regards</P><P> </P><P>Oliver</P><SCRIPT>      var bodytag = "<body style='font-size:9pt; font-family:Verdana; font-family: Verdana' >";       document.body.style.fontFamily ='Verdana';              function strip(value) {         while (value.indexOf(" ")==0) {                       value = value.substring(1,value.length);                }               return value;   }                               var bodystyle = 'font-size:9pt; font!
 -family:Verdana; font-family: Verdana';                var styles = bodystyle.split(";");                            for (i=0; i<styles.length; i++) {                    werte = styles[i].split(":");                 var key = strip(werte[0].toLowerCase());                        var value;                      if (werte.length>2) {                                value = werte[1];                               for (j=2;j<werte.length;j++) {                                       value = value + ":" + werte[j];                               }                               value = strip(value);                   } else {                                value = strip(werte[1]);                        }                                               switch(key) {                           case "background-position":                                   document.body.style.backgroundPosition = value;                                 break;                          case "font-weight":                                   document.body.style.fontWeight = value;                                 break;                          case "font-size":                                     document.body.style.fontSize = value;                                   break;                          case "background-image":                                      document.body.style.backgroundImage = value;                                    break;                          case "margin":                                        document.body.style.margin = value;                                     break;                          case "color":                                 document.body.style.color = value;                                      break;                          case "background-repeat":                                     document.body.style.backgroundRepeat = value;                                   break;                          case "font-style"!
 :                                      document.body.style.fontStyle = value;                                  break;                          case "font-
family":                                   document.body.style.fontFamily = value;                                 break;                          case "background-color":                                      document.body.style.backgroundColor = value;                                    break;                          case "margin-left":                                   document.body.style.marginLeft = value;                                 break;                          case "margin-right":                                  document.body.style.marginRight = value;                                        break;                          case "margin-top":                                    document.body.style.marginTop = value;                                  break;                          case "margin-bottom":                                 document.body.style.marginBottom = value;                                       break;                  }               }       </SCRIPT></body></html>
______________________________________________________________________________<br>Umfassender Spam-Schutz fur alle - bis zu 99% spamfreier Posteingang<br>WEB.DE FreeMail Deutschlands beste E-Mail - <A HREF="http://f.web.de/?mc=021131"><B>http://f.web.de/?mc=021131</B></A>