UDF in Personal.xls (SOLVED)

phantom1975

MrExcel MVP
Joined
Jun 3, 2002
Messages
3,962
I have the following UDF that works fine in the Workbook module:<pre>Function ThisPath()
ThisPath = ActiveWorkbook.Path
End Function</pre>

When I put the same Function in my Personal.xls, it won't work. Am I missing something?

_________________
...................****************** EXCEL/VB NEWBIES ARE MY <font color="red"> FAVORITE</font>! *****************...................<font color="blue">The only dumb question is the one that isn't asked. Pass on what you have learned.
This message was edited by phantom1975 on 2003-01-22 18:22
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
This works fine for me as long as the activeworkbook has been saved. Otherwise the path will return nothing.
 
Upvote 0
It could be that you have that same udf in multiple workbooks. To use the one in Personal.xls you'll need to select Personal.xls!ThisPath from the User-Defined category of the Paste Function gui.
 
Upvote 0
I deleted the UDF in the workbook and kept only the UDF in the Personal.xls workbook. I wanted to make sure that the function would work. I just can't get it to work if I have it in the Personal.xls workbook. Do I have to set it up as an add in?

_________________
...................****************** EXCEL/VB NEWBIES ARE MY <font color="red"> FAVORITE</font>! *****************...................<font color="blue">The only dumb question is the one that isn't asked. Pass on what you have learned.
This message was edited by phantom1975 on 2003-01-22 17:16
 
Upvote 0
I do not like personal xla / xls whatever its called, pecky annoying thing. Never works that well. Networks makes this all most impossible - worst still if images remote installs.

What i suggest is save as add in and place in correct windows location and load correctly

This will never fails and does the same job as Personal.xxx and better, easy turn on off.

I must have some 30 odd UDF in this fashion and this will distroy excel and dirty memory if run from personal, i switch them on off and as i need then,

I do not have a single problem, as i re write and update, i replace the add in and re load, simple approach

HTH

Jack
 
Upvote 0
I've never created an add-in before. I know that there is a property in the ThisWorkbook to change it to an add-in. Do I need to change the file extention too? Can I save macros in the same fashion or do those need to stay in the Personal.xls?

_________________
...................****************** EXCEL/VB NEWBIES ARE MY <font color="red"> FAVORITE</font>! *****************...................<font color="blue">The only dumb question is the one that isn't asked. Pass on what you have learned.
This message was edited by phantom1975 on 2003-01-22 17:43
 
Upvote 0
H Phantom1975

sorry you do not know ho to made and add in? But you can code VBA on your own?

If so no problems let me know and ill type up some step by steps and your home and try

Just so i know where to help you?

Jack
 
Upvote 0
I put the UDF in the MODULES folder in a new workbook. I then changed the IsAddIn property of the ThisWorkbook to TRUE. I was able to successfully add the functions in. Since you have me thinking about not using the Personal.xls file, is it possible for me to move macros in the same fashion? I have some custom buttons that use macros in my Personal.xls.
 
Upvote 0
Phantom1975

Ill translate that as a no then, I’ve no idea what you are doing or tying to. I see that as a complicated method to get ??? where ever, like i say ill type something up and post on this feed, im going off line for few minutes

Don’t worry im not off to talk to myself in my own forum, i have said i will reply and reply i will .


Jack
 
Upvote 0
OK

Get you code from personal all of it, copy do not cut just in case

Open new Wkbk
Rename it Phantoms_AddIn_1 [name as needed]
Now in sheet one, put all your rubbish, your copy’s of codes notes anything you might need, test codes [this you put in cells so you do not run them, try to keep in just one cell each chunk of data] to refer to later if needs be. You know ideas and so on so you don’t forget.

Now save

Now paste in your code in standard module [same as in personal.xxx]

Now save as and choose drop down, scroll to bottom and your see XLA, keep the file name the same and save

You now have one XLA and one XLS, keep the xls for modifications and new version, ie new version same but call ….. 2

Now put the add in the correct location for add ins
Now load the add in the correct fashion.

Bingo

BTW you can view and edit the xla in the VBE warning the XLA will not be changed so you loose amendments as the XLA will not change your need to edit the xls and re make the xla

These many ways or doing these things I find this simpler and easier, having one xls and one xla each time, re loading the new version of XLA as its amended and removing the old xla.

Hope this helps

Jack
 
Upvote 0

Forum statistics

Threads
1,216,462
Messages
6,130,781
Members
449,591
Latest member
sharmavishnu413

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top