Macro - to change logical attribute names to physical column names based on Naming standards

Hi there, I am new to the forum and sorry if I re-posted something which is already been discussed. I have a requirement where I need to convert all the logical attribute names *(1500 of them) into corresponding physical column name based on our abbreviation glossary standards. Like example:

The logical name of the attribute, 'account request action code' should be converted as physical column name: ACNT_RQST_ACTN_CDE. 

Please suggest any existing macro I can download or appropriate changes to the code I attached here. Everytime, I am running the macro, the ER/studio is crashing without any error message.

Attached is the code. Line # 96 is where I am pointing to naming standards glossary.

Appreciate your help.