NOTICE: Significant community changes coming soon
The header menu and the home page on our community will be changing soon. Get more information HERE.
Highlighted
Absent Member.
Absent Member.
197 views

<No Value> in array - type mismatch error

Hi,

I have 2 arrays which are loaded with data from an excel file -

arrayA = objMyDataExcelA.Worksheets(workingSheet).UsedRange.Value

arrayB = objMyDataExcelB.Worksheets(workingSheet).UsedRange.Value

I then compare values in the array to report differences -

if arrayA(1,1) <> if arrayB(1,1) Then

    Do Stuff

End if

However I run into problems when the excel has formula errors and the cell contains "#N\A".  Looking at the debugging in UFT the array contains "No Value" when the excel has #N\A and when I try to compare the "NO Value" array elements i get a type mismatch error.

I tried playing around with IsNull to try and replace the errors with some text but IsNull appears to report False for the "No Value" elements

 

Any ideas?

0 Likes
0 Replies
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.