• UDFs in VBE: can't reference my file

    Author
    Topic
    #463364

    I have written some UDFs and want to be able to use them without referencing the full “filename.ext!function”.

    I got out my trusty J. Walkenbach Excel 2007 Bible and, sure enough, he tells me how to do it. Unfortunately, Excel won’t let me.

    I go to Tools, References and in the dialogue box I see the list of choices, my file isn’t there, so I browse and find it, select it and in the choices list is, not my file name, but “vbaproject.” Of course, my module, in the VBE is called”VBAProject(PERSONAL.XLS).

    When I select “vbaproject” in the References dialogue box I get an error saying “Name conflicts with existing module, project or library” Also, there are two instances of “vbaproject” in the list of choices and no way I can find to remove one or both.

    Can someone help, please?

    Thanks,

    Cellmate

    Viewing 1 reply thread
    Author
    Replies
    • #1182632

      You should give the VBA project in your Personal.xls a unique name:
      – Activate the Visual Basic Editor.
      – In the Project Explorer on the left hand side, click on VBAProject (Personal.xls).
      – In the Properties pane, you’ll see that the (Name) property is set to VBAProject.
      – Click in this property and enter a new, unique name, for example MyPersonal
      – In the Project Explorer, click on the workbook where you want to use the user-defined functions.
      – Select Tools | References…
      – You should now see the name MyPersonal or whatever you specified. Since it’s unique, you can tick its check box.

    • #1182638

      Hans, PERFECT!!! Exactly what I needed.

      thanks, so much!

      Cellmate

    Viewing 1 reply thread
    Reply To: UDFs in VBE: can't reference my file

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: