LenH was declared as a LONG variable, so it can only be a whole number greater than zero.
So the error on that line of code could mean:
1. wbMEgdF no longer is defined. When you debug, hover your mouse over this and see if it pops up a value for wbMEgdF
2. Worksheets("Data&Parms") can't be found in the wb that IS currently defined in wbMEgdF. If #1 is ok, check that current wb for a sheet with that exact name (no hidden spaces at the end).
3. The value in Range("B1") cannot legitimately fill the LenH variable.
You might try one of Excel's built in string functions that might successfully convert a "string" value into a long value...
Bookmarks