Jump to content
Sign in to follow this  
dar100111

_excel_rangeread

Recommended Posts

dar100111

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
JLogan3o13

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!

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites
dar100111

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
water

@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 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
dar100111

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
water

Which version of Excel do you run?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
dar100111

2010

Share this post


Link to post
Share on other sites
dar100111

Correction 2013 now

Share this post


Link to post
Share on other sites
water

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 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
water

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


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
dar100111

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
water

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 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
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  

×