Jump to content

Recommended Posts

Posted

Hello everyone :),

I have spotted a weird problem with the Excel COM API. It doesn't read a spreadsheet with a good amount of lines in a cell... Enough talk, let's get into code:

#include <Array.au3>
#include <Excel.au3>

Global $oExcel = _Excel_Open(False, False, False, False, True)
Global Const $sSpreadsheet = @ScriptDir & '\Test.xlsx'
Global $oSpreadsheet = _Excel_BookOpen($oExcel, $sSpreadsheet, True, False)
Global $aSpreadsheet = _Excel_RangeRead($oSpreadsheet)
If @error Then MsgBox(0, "Error", 'Error Code: ' & @error & @CRLF & 'Extended Code: ' & @extended)
_Excel_Close($oExcel, False)

_ArrayDisplay($aSpreadsheet)

(Download Test.xlsx)

I get this error when I run the script:

Ewdmawg.png

If you open the spreadsheet, you can see that I have dummy text in the B2 cell. If you replace the contents of the cell B2 with something like Test4, it will work perfectly fine:

3D099FA.png

 

Is this some kind of undocumented line limit for Excel? :ermm:

Thanks in Advance! TD :thumbsup:

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Posted

this, from the rangeread helpfile?

  Quote
$bForceFunc [optional] True forces to use the _ArrayTranspose function instead of the Excel transpose method (default = False).
    See the Remarks section for details.
Expand  

 

  Reveal hidden contents

Posted

Maybe you hit this limitation?

  Quote

The Excel transpose method doesn't support cells with more than 255 characters.

Expand  

 

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

:)

My UDFs and Tutorials:

  Reveal hidden contents

 

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
×
×
  • Create New...