Jump to content

Problem with _Excel_RangeRead


Jewtus
 Share

Go to solution Solved by water,

Recommended Posts

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?

Link to comment
Share on other sites

  • Moderators

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

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • Solution

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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...