Excel comparison cell by cell using Text method returning hash characters
I'm trying to compare two excel files cell by cell and then calling aqString.Compare to do the actual comparison on the text returned. I've got the mechanism working; however, the 'Text' method appears to return what is visible in the cell, but not always the actual value i.e. if a date is too long for the column width, hash characters are displayed and are returned by the Text method. This means that, for example, both excel files return ######## and that aqString.Compare(str1, str2, false)) will return 0 (i.e. the strings are the same). I deliberately changed the dates so they were different.
The 'value' method returns nothing
Does anyone know away to return the actual cell value or to apply AutoFit when working with files that are not open and visible on the desktop
Solved! Go to Solution.
Are you using which method to get the cell value using Range("A1") or Cell(1,1)?
both has property called Value2 or Value_2 to get cell value can you try these.
If still face any issues, post your code here.
LinkedIn | CG-VAK Software | Bitbucket | email@example.com“You must expect great things from you, before you can do them”
Value2 doesn't actually display the date in a date format, unfortunately, but it does at least recognise the difference in the dates which is the main thing