473,503 Members | 10,322 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.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
Jul 18 '05 #1
0 1554

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3622
by: calfdog | last post by:
Hello, I have been doing some experimenting with Automating Internet Explorer for testing. I would like to read from Excel and use the data to set the values of my text boxes on my web forms....
0
2467
by: Gardner Pomper | last post by:
Hi, I am pretty new to python, so be gentle :) I have a python script that spawns a number of threads (configurable) on a 12 processor AIX RISC-6000 machine. It works fine, so long as I am...
0
1642
by: justin worrall | last post by:
Hi,   I have a very simple python win32 example (gleaned from the O'Reilly book on Win32 programming for Python), of an Excel client with a COM server. Essentially I have three VB buttons -...
2
2165
by: nvhengr | last post by:
Has anyone seen this? When I run the COM Makepy utility and choose Microsoft Excel 9.0 Object Library (1.3), I get an application error message: PythonWin: Pythonwin.exe - Application Error...
10
3660
by: Andrew Dalke | last post by:
Is there an author index for the new version of the Python cookbook? As a contributor I got my comp version delivered today and my ego wanted some gratification. I couldn't find my entries. ...
1
2853
by: Oliver Schuetze | last post by:
Hi, I am a C++ beginner and therefore I can solve the following problem unfortunately not without your assistance. For a C++ professional it is probably a minute to think about... The...
1
11432
by: Alejandra Parra | last post by:
I have the next code: Dim Script As Object = CreateObject("MSScriptControl.ScriptControl") I've run this application in WinXP and it works normally, but if I run the application in Win98, the...
0
2722
by: liam_jones | last post by:
I'm very new to Python, well IronPython to precise, and have been having problems when using Excel. The problem I'm having is the closing of my Excel object. I'm able to successfully quit the...
0
7207
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7294
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7361
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7470
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5602
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4693
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3183
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
749
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.