Sign in to follow this  
Followers 0
Jewtus

Problem with _Excel_RangeRead

5 posts in this topic

I'm trying to do the following command:

$List="C:\Testfile.xlsx"
$excelOpen=_Excel_Open(False)
$excelBook=_Excel_BookOpen($excelOpen,$List,False,1)
$test=_Excel_SheetList($excelBook)
For $z=0 to UBound($test) -1
    $aSheet=_Excel_RangeRead($excelBook,$test[$z][0])
    _ArrayDisplay($aSheet)
Next
_Excel_Close($excelOpen)

But I keep getting an error message:

"C:\Users\n811761\Desktop\Autoit - Portable\Beta\Include\Excel.au3" (736) : ==> The requested action with this object has failed.:
$vResult = $oExcel.Transpose($vRange.Value)
$vResult = $oExcel^ ERROR

However, if I remove the the search for a specific worksheet, it works without issue. Is there a known issue with the Excel UDF?

Share this post


Link to post
Share on other sites



What AutoIt version, Windows version, Office version, etc.? I cannot reproduce the error with your code on WIN7 x64 with Office 2007 and 2010.


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

Share this post


Link to post
Share on other sites

How many cells do you try to read? Are there cells with more than 255 characters content?


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
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Autoit Version:

3.3.13.19

OS:

Windows 7 Professional

Excel Version:

14.0.7132.5000 (Microsoft office 2010)

 

@water

yes, there are some fields with > 255 characters

there are 30 columns of data and about 200 rows

When I work with CSV files, I have no issue. Is excel limited to 255 chars?

I was going to do this to convert it to a CSV file if I cannot figure this out:

$oExcel = ObjCreate("Excel.Application")
    $oBook= $oExcel.Workbooks.Open($InList)
    $oBook.SaveAs($OutList, 6)
    $oBook.Close(False)
    $oExcel.Quit
Edited by Jewtus

Share this post


Link to post
Share on other sites

The Excel method Transpose is limited to 255 chars. Please set the appropriate parameter of _Excel_RangeRead to use the internal function.


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
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

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