I found the following code here
I placed it in a module of PERSONAL.XLS that auto-opens hidden.Please Login or Register to view this content.
However, it gives me #NAME? instead of the result
Can someone help please.
I found the following code here
I placed it in a module of PERSONAL.XLS that auto-opens hidden.Please Login or Register to view this content.
However, it gives me #NAME? instead of the result
Can someone help please.
Sounds like you need to add a Reference to your Personal book.
In the VBE go to Tools > References and make sure the name your Personal Book is included (is ticked).
You need to include the workbook name if it's not an add-in:
=Personal.xls!add_num(...)
Rory
"=Personal.xls!add_num(...)"
It now runs but...
Add:
to the code.Please Login or Register to view this content.
That fixed that error, now I get this.
How should this be defined?
You'd have to rename the project before you can set a reference, but you don't need it set.
Add:
to your getnumber function.Please Login or Register to view this content.
Yes, it works now, Thank you!
Regarding the duplicate entry "VBAProject" in the available references, how do I delete one? How can I see the full path of the "Location"?
What project must I rename?
Can I add a reference to my personal.xls so that I do not have to type personal.xls!"function name"?
Last edited by drgkt; 05-14-2019 at 03:39 AM.
You don't need to delete it, just rename one.
To rename your Personal Workbook - Open the VBE and find it in the Project Window, right click on it and select 'VBAProject Properties' - It'll open a Dialog Box where you can give it a new name.
Once you've give it a name it should stop the conflict.
You really don't need to rename the Personal project. If you set a reference, you will have to do that in every single workbook that you use the functions in. It is much simpler, IMO, to create an add-in with your functions in it. Once that is installed, you won't need to include the workbook name when calling the functions in it.
In my previous post I included a screenshot that shows the left pane of the VBE. There there is a "personal" and a "calendar" project. Is that the reason I have 2 "VBAProject" entries in the available references?
But then again I also have a "book1" project. By the same logic I should have 3 entries on the right.
Eitherway, Shouldn't they be already selected on the right dialog box? I do not understand.
@rorya: How do I create that add-in. Besides, I think it defeats the purpose auto loading the personal.xls (hidden) if I have to include its name in the functions. It should work like the macros do.
All workbooks have a project and by default they are called vbaproject so if you have book1 and your personal macro workbook open, you'll have 2 vbaproject references available.
Just save a workbook containing the code as an add-in. You may think that's how it should work, but it doesn't so you have to work with the reality.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks