jarek Posted April 6, 2010 Share Posted April 6, 2010 (edited) Hello I have prepared a script which works fine on my XP + Office 2007. However the script will be used on Server 2008 + Office 2003. The script below is just to show you the problem: #include <WinAPI.au3> $oExcel = ObjCreate("Excel.Application") $oExcel.WorkBooks.Open("rz.xls") It works on my local machine but fails on Server 2008 + Office 2003. The message is: Error: Variable must be of type "Object" The file of course exists and is accessible. I believe it has something to do with COM. Please help me! thanks, Jarek EDIT: I do not know what have I done but suddenly this script stopped working on my local machine (XP + Office 2007). The error message is different: The requested action with this object has failed Edited April 6, 2010 by jarek Link to comment Share on other sites More sharing options...
blakel Posted April 6, 2010 Share Posted April 6, 2010 First check if ObjCreate is returning an object. Check @error on return for errors and/or use IsObj(). If it quit working, try a restart to make sure all the processes are cleaned up. Link to comment Share on other sites More sharing options...
Juvigy Posted April 7, 2010 Share Posted April 7, 2010 Specify the full path to the file. For example: $oExcel.WorkBooks.Open("C:\somedir\rz.xls") Link to comment Share on other sites More sharing options...
jarek Posted April 7, 2010 Author Share Posted April 7, 2010 Specify the full path to the file. For example:$oExcel.WorkBooks.Open("C:\somedir\rz.xls")thanks Juvigy, full path is the answer to my problem! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now