VBA underlying application will normally standardize declared variables and function names, I am no expert on how the logic is applied, but I would assume that it would look in .xlam modules for reference functions and macro names when they are used in .xlsm workbooks. So I cannot explain why that particular code is giving you a problem. I have tried to duplicate it and cannot. Mine all changes to the same case throughout, Based on what the original usage or declaration was. Is it possible that you have anoter macro or function in the .xlam file that uses the same variables but with the upper case letters? (although, I don't see how that could be, based on the application standard). Big mystery!