Pulling File Name in Excel VBA

  • So I have some code (see below) that works as intended when I was running it within the desired workbook.
    However, when I added it to my Personal Workbook (more accurately an Add In i built) it does not execute they way I want it to, and here is why.


    There is an IF Else If Statement which looks at the name of the workbook, and based on that, executes a set of commands. The problem now is (I believe) that the code is not seeing the name of the workbook, but rather the name of my Add In.


    My question is this, how do I pull the name of the workbook, and not the name of my Add in?
    The name of my Add in is "LAST_NAME.xlam


    See code snipit:




    Any help on this particular issue or any suggestions on improving this code is greatly appreciated

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!