python ScriptControl error in Excel while running fine in python

Discussion in 'Python' started by Sebastien de Menten, Feb 1, 2005.

  1. 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.ExecuteStatement ("import os")
    os_getcwd = sc.Eval("os.getcwd()")
    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.client.Dispatch("ScriptControl")
    sc.Language = "python"
    sc.ExecuteStatement ("import os")
    print sc.Eval("os.getcwd()")

    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
     
    Sebastien de Menten, Feb 1, 2005
    #1
    1. Advertisements

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. ^CrazyCoder^
    Replies:
    3
    Views:
    7,637
    Terrence Benade
    Sep 15, 2003
  2. David
    Replies:
    1
    Views:
    628
    David
    Jul 19, 2004
  3. Oliver Schuetze

    Extension to ScriptControl-OCX ?

    Oliver Schuetze, Nov 24, 2003, in forum: C++
    Replies:
    1
    Views:
    830
    Jack Klein
    Nov 25, 2003
  4. Sam
    Replies:
    0
    Views:
    546
  5. Benjamin Rutt
    Replies:
    2
    Views:
    1,100
    Peter Hansen
    Dec 20, 2005
  6. =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=

    Problem with Excel reports ::::Excel 2003 Migration To Excel 2007

    =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=, Oct 5, 2007, in forum: ASP .Net
    Replies:
    15
    Views:
    1,943
    =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=
    Oct 24, 2007
  7. ashjas
    Replies:
    7
    Views:
    490
    ashjas
    Dec 10, 2007
  8. hisan
    Replies:
    2
    Views:
    604
    Ned Deily
    Jun 9, 2011
Loading...