What a day

Isaac

Lifelong Learner
Local time
Today, 09:12
Joined
Mar 14, 2017
Messages
11,055
I recently wrote a function to determine whether 2 Excel workbooks were the same - Sheet count, Sheet names, Header values of all sheets. (True/false).

Over the past 24 hours, I've probably spent 3-4 hours troubleshooting why it was returning "False" when I KNEW the files were the same - I created one as a copy!

Having gotten to where I usually write code correctly the first time, I was so perplexed. I sat in debug mode, staring at a Set statement failing to Set -

For Each wsOld in wbOld.Worksheets
Set wsNew = wbNew.Worksheets(wsOld.Name)
...
Next wsOld
etc.

My most recent hunch was there was something about wsOld.Name that wasn't appropriate for a Worksheets() index reference - even though MS clearly states Worksheet.Name returns a String Value, so it must be OK.

Literally 3 hours........Until I realized something extraordinary. Worksheet is not spelled Worksheeet

Who knew !? 🤯
 
Let those amoung us who have not misspelled, cast the first stone.

Glad to see it isn't only me...
 
I thought you were going say there was a hidden space or something like that.
 
Reading exactly what is written rather than what is expected is a skill picked up after many years of coding.
I also do a lot of proof reading where I work. Noticing valid but inappropriate words that are not evident in spell checkers needs that kind of attention. Noticing inconsistent punctuation is a speciality as it is so important in coding.
 
Reading exactly what is written rather than what is expected is a skill picked up after many years of coding.
I also do a lot of proof reading where I work. Noticing valid but inappropriate words that are not evident in spell checkers needs that kind of attention. Noticing inconsistent punctuation is a speciality as it is so important in coding.
Agreed. I was surprised at how much time I spent with my eyes looking directly at the three e's in worksheet and not seeing it. Crazy
 

Users who are viewing this thread

Back
Top Bottom