python ScriptControl error in Excel while running fine in python

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sebastien de Menten

    #1

    python ScriptControl error in Excel while running fine in python

    I am trying to use ScriptControl under Excel (Windows XP) with the
    code:

    Global sc As New MSScriptControl .ScriptControl

    Public Function os_getcwd()
    sc.Language = "python"
    sc.ExecuteState ment ("import os")
    os_getcwd = sc.Eval("os.get cwd()")
    End Function

    When setting the language to python I have the error "A script engine
    for the specified language..."

    On the other side, under python, the translated code:

    import win32com.client

    sc=win32com.cli ent.Dispatch("S criptControl")
    sc.Language = "python"
    sc.ExecuteState ment ("import os")
    print sc.Eval("os.get cwd()")

    works without any problem !

    So, is it possible that a different set of permissions for languages
    available in ScriptControl is used when executed from Excel or from
    python ?
    Is it possible to ask the available languages to ScriptControl ?

    Well, in fact I am totally puzzled by this behaviour so any help is
    welcome :-)

    Sebastien

    PS: could you reply to my email address as I do not read regularly
    c.l.p. ? thanks
Working...