Thanks for the response. When running my code myself, I found that the actual problem was that the code was not compiling, with an error stating "Can't find project or library" when referring to "Environ." I found elsewhere online that putting "VBA" in front of "Environ" fixes this issue, so that is what I have done.
http://www.experts-exchange.com/Programming/Languages/Visual_Basic/Q_20419078.html