Jump to content

ExcelRangeRead intermittent error


Masum
 Share

Recommended Posts

Hi all,

I'm facing a random error, whereby the ExcelRangeRead function is storing the first letter of a string as a lowercase rather than the uppercase it is stored in Excel. This happens about 10% of the times. And only with one of the ExcelRangeRead functions below, Global $RTERuleName = _Excel_RangeRead($oWorkbook, 'CHFT Pools & RTE Rules', 'I' & $Row)

Func ExtractDCWData()
    Global $PoolName = _Excel_RangeRead($oWorkbook, 'CHFT Pools & RTE Rules', 'G' & $Row)
    Global $PoolDescription = _Excel_RangeRead($oWorkbook, 'CHFT Pools & RTE Rules', 'H' & $Row)
    Global $RTERuleName = _Excel_RangeRead($oWorkbook, 'CHFT Pools & RTE Rules', 'I' & $Row)
    Global $FirstName = _Excel_RangeRead($oWorkbook, 'CHFT Pools & RTE Rules', 'F' & $Row)
    Global $LastName = _Excel_RangeRead($oWorkbook, 'CHFT Pools & RTE Rules', 'E' & $Row)
    Global $Notes = _Excel_RangeRead($oWorkbook, 'CHFT Pools & RTE Rules', 'L' & $Row)
    Sleep(200)
EndFunc   ;==>ExtractDCWData

The excel column looks like this.

Capture.PNG

The script that writes the data out is as follows.

Func AddRTERule()
    MouseClick('Primary', 69, 657, 1) ;Click Rules...
    Sleep(200)
    MouseClick('Primary', 363, 228, 1) ;Click Type
    Sleep(200)
    MouseClick('Primary', 363, 266, 1) ;Click RTE
    Sleep(200)
    MouseClick('Primary', 363, 545, 1) ;Click New Rule
    Sleep(200)
    Send($RTERuleName) ;Enter Mnemonic
    Sleep(200)
    Send('{TAB}') ;Enter Description
    Sleep(100)
    
    ;Theres more lines of code in this function...
    
EndFunc   ;==>AddRTERule

Any ideas?

 

Link to comment
Share on other sites

What you get from _Excel_RangeRead is the RAW VALUE of the cell. What you see on the screen is the FORMATTED VALUE.
Make sure that there is no formatting rule on the cells setting the first letter to uppercase.

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

×
×
  • Create New...