Jump to content
stealth

[Solved] _Excel_RangeRead bug or (my) user error?

Recommended Posts

stealth

Having issues using "3 - The displayed text" in $iReturn parameter of _Excel_RangeRead. I want values from an Excel spreadsheet.

Helpfile for _Excel_RangeRead: "4 - Parameter $iReturn is invalid. Has to be > 1 and < 3"

Should this be: "4 - Parameter $iReturn is invalid. Has to be>1 and < 4" ?

 

Also, when adjusting Example 3 of _Excel_RangeRead  

from 

; *****************************************************************************
; Read the formulas of a cell range (all used cells in column A)
; *****************************************************************************
Local $aResult = _Excel_RangeRead($oWorkbook, Default, $oWorkbook.ActiveSheet.Usedrange.Columns("A:A"), 2)
If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeRead Example 3", "Error reading from workbook." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeRead Example 3", "Data successfully read." & @CRLF & "Please click 'OK' to display all formulas in column A.")
_ArrayDisplay($aResult, "Excel UDF: _Excel_RangeRead Example 3 - Formulas in column A")

to

; *****************************************************************************
; Read the formulas of a cell range (all used VALUES in column A)
; *****************************************************************************
Local $aResult = _Excel_RangeRead($oWorkbook, Default, $oWorkbook.ActiveSheet.Usedrange.Columns("A:A"), 3)
If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeRead Example 3", "Error reading from workbook." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeRead Example 3", "Data successfully read." & @CRLF & "Please click 'OK' to display all formulas in column A.")
_ArrayDisplay($aResult, "Excel UDF: _Excel_RangeRead Example 3 - Formulas in column A")

I get @error = 5, @extended =-2147352567

-2147352567 seems to do with Regional settings.

Would the @ScriptDir & "\Extras\_Excel1.xls" being in German ("Tabelle1") have to do with this?

Or are both of these issues my user error?

Edited by stealth

Share this post


Link to post
Share on other sites
water

The help file has been fixed.

Unfortunately Excel only allows to retrieve the displayed text for a single cell.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.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
stealth

Thank you for explaining, water

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

×