Mucho Posted November 2, 2009 Share Posted November 2, 2009 I'm running Excel 2003 in my Windows 7 with the following code Global $FileName = "C:\Users\TomCar\AppData\Roaming\Microsoft\Excel\XLSTART\Personal.xls" Global $oExcel = _ExcelBookopen($FileName) $oExcelDoc = ObjCreate("Excel.Application") $oExcelDoc.Visible = 1 $oExcel.Application.Run("All_Process") But it can't be opened and I got the following error message: D:\Stock Maintenance\Maintenance\InetGet & Convert SGX.au3 (76) : ==> Variable must be of type "Object".: $oExcelDoc.Visible = 1 $oExcelDoc^ ERROR I don't seem to get this problem using Excel XP in both WinXP and Win2000. Link to comment Share on other sites More sharing options...
PsaltyDS Posted November 2, 2009 Share Posted November 2, 2009 I'm running Excel 2003 in my Windows 7 with the following code Global $FileName = "C:\Users\TomCar\AppData\Roaming\Microsoft\Excel\XLSTART\Personal.xls" Global $oExcel = _ExcelBookopen($FileName) $oExcelDoc = ObjCreate("Excel.Application") $oExcelDoc.Visible = 1 $oExcel.Application.Run("All_Process")But it can't be opened and I got the following error message: D:\Stock Maintenance\Maintenance\InetGet & Convert SGX.au3 (76) : ==> Variable must be of type "Object".: $oExcelDoc.Visible = 1 $oExcelDoc^ ERRORI don't seem to get this problem using Excel XP in both WinXP and Win2000.I don't see why it would produce an error, but also don't see why you bother creating an additional Excel.Application object after _ExcelBookopen() already has. What's the point of $oExcelDoc when you already have $oExcel? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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