View Full Version : extracting info from excel

04 April 2009, 01:12 AM
hey all,

Is there any way I can read a list of files specified in excel and execute commands as a batch process. I need this to be done in Mel since i do not want to install any python modules on all computers.

Hope this makes sense,


04 April 2009, 02:25 AM
I'm not an expert in Office formats, but out of curiosity I did some searching. I found this page:

It says that excel 2007 uses an Open XML format, which means you should be able to use python's built-in xml parsing modules (no need to install additional modules).

However, if you're willing to install 3rd party modules, I came across this which would probably save you a lot of time. What is your concern with distributing modules? You have to provide these machines with your script anyway, it's just as easy to provide the machines with two files as it is to provide one...


04 April 2009, 03:30 AM
Thanks chad for the reply,

The problem is that in my worlplace python is not installed on the user machines and hence any python usage is resticted to what Maya provides. Hence the module distribution problem. In XSI using Javascript I just had to create an Excel object and data could be imported. Was wishing a similar approach.

04 April 2009, 06:25 AM
so, if you were going to write a mel script, where would you put it? on a server where all machines can see it? you can do the same thing with python. just put the two scripts -- yours and the one it depends on -- in a directory where all machines can access them. there are a number of ways that you can make sure that these files are seen by maya's python, but the most brute force way is this:

import sys
sys.path.append( '/global/python/folder')

alternately, you can set the PYTHONPATH var in each machine's Maya.env.

my point is that, there's no more need to distribute python scripts than there is to distribute mel scripts and setup-wise, its not any harder to use a python than mel.


CGTalk Moderation
04 April 2009, 06:25 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.