Sign in to follow this  
Followers 0
dar100111

_excel_rangeread

12 posts in this topic

I am wondering if my file is too big to read to Array.  I have about 5000 rows and 77 columns

I am getting this error:

@error = 5, @extended = -2147352571

I cut down the number of lines and it works.

What should I do in this instance?

Thanks!

#include <IE.au3>
#include <File.au3>
#include <Excel.au3>
#include <Array.au3>
#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include <WindowsConstants.au3>

$oApp=_Excel_Open()
$oExcel = FileOpenDialog("Select", @ScriptDir & "\", "Files (*.csv)", 1)
$oWorkbook=_Excel_BookOpen($oApp, $oExcel, Default)
$aResult=_Excel_RangeRead($oWorkbook, Default)
If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Error Reading File to Array", "Error with Excel Range Read." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
_ArrayDisplay($aResult)

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I thought the row limit for anything beyond 2003 was 16,384, but water may be able to speak to it better (can't find the link I am looking for online at the moment). There is something in the help file remarks about a row limitation.

Edited by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

I tried it as xlsx rather than csv and it worked!  Maybe it's the file type.

Share this post


Link to post
Share on other sites

@error = 5 is returned when an error occurred when reading data. @extended is set to the COM error code

Do you have any invalid data (division by 0 or similar) in the range you read?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Hey Water!  Was looking in the help file to see what they meant. Where can I file a list of all those error messages and @extended com errors.?

I doubled up the line amounts and it read 8000 rows just fine when I changed the excel file type.

Share this post


Link to post
Share on other sites

Which version of Excel do you run?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

2010

Share this post


Link to post
Share on other sites

Correction 2013 now

Share this post


Link to post
Share on other sites

Do you still get the error when you try:

$aResult=_Excel_RangeRead($oWorkbook, Default, Default, Default, True)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

I forgot to ask: Which AutoIt version do you run?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Yes it looks like will run on the csv version Water with those parameters. Running the latest beta.

Edited by dar100111

Share this post


Link to post
Share on other sites

I've modified the function so it automatically sets $bForceFunc to True when the copied range has > 65536 cells.

Unfortunately the limitation of the transpose method hasn't been documented by MS :(


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

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  
Followers 0