python ScriptControl error in Excel while running fine in python

  • Thread starter Sebastien de Menten
  • Start date
S

Sebastien de Menten

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top