MacBain00 Posted May 19, 2010 Share Posted May 19, 2010 I'm creating an AutoIT script to automate an Excel sheet to Excel sheet transfer including some transformations. Basically column A from one sheet is moved to Column D, Column B to Column A, etc etc. This should be a relatively simple script, but am having an issue with the script crashing after a specific set of code. I ripped out all the GUI code and other random calls and ran the script. It works without any issues. See Code below. When i put the same exact code into my full code, I get an _ExcelReadArray error which makes no sense to me. Any assistance you can provide is appreciated. Working Test Code without any issues: Local $oExcelMDS, $oExcelGSK, $TempArray $oExcelMD = _ExcelBookOpen("file1") $oExcelGS = _ExcelBookOpen("file2") _ExcelSheetActivate($oExcelMD, "ISS") _ExcelSheetActivate($oExcelGS, "B") $TempArray = _ExcelReadArray($oExcelGS, 4, 3, 17, 1) _ArrayDisplay($TempArray) _ExcelWriteArray($oExcelMD, 10, 6, $TempArray, 1) Error Message experienced by dumping the same code into my full program: C:\Program Files\AutoIt3\Include\Excel.au3 (530) : ==> The requested action with this object has failed.: $oExcel.Activesheet.Cells(($xx - $iIndexBase) + $iStartRow, $iStartColumn).Value = $aArray[$xx] $oExcel.Activesheet.Cells(($xx - $iIndexBase) + $iStartRow, $iStartColumn)^ ERROR ->11:36:53 AutoIT3.exe ended.rc:1 The same exact files are being used to generate one vs. the other. I can post any other code as required. Any assistance from the community is appreciated. -Work Smarter, Not Harder, Use More AutoIT Link to comment Share on other sites More sharing options...
MacBain00 Posted May 19, 2010 Author Share Posted May 19, 2010 Nevermind. It wasn't the read array, it was my write array. Had a bad variable that I corrected. Thanks for the views anyway. =) -Work Smarter, Not Harder, Use More AutoIT 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