Jump to content
Sign in to follow this  

_ExcelReadArray Issues

Recommended Posts


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)
_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

Share this post

Link to post
Share on other sites

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

Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.