Excel 2007 - UDF always gives #NAME?

Reljoy

New Member
Joined
May 6, 2010
Messages
8
I've been reading the posts on getting Excel to put a picture into a spreadsheet. However, every time I try to use the function I get a #NAME? error.
I do not get the function name to appear in the Insert Function Wizard.
I have been to the trust center and made sure that the folder I am working in is trusted.
What am I missing?
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
The UDF has o go into a standard code module, have you put it there?
 
Upvote 0
I typed ALT + F11 and then I Went to Insert and Module. Is that a standard core module?
I have also tried pasting the code into 'Sheet1 (Review IT)' and 'ThisWorkbook'.
I always get the same error message no matter where I paste the code in.
 
Upvote 0
The first one (where you Insert Module e.g. Module1, Module2 etc.) is a standard code module. That's where your UDF code should go.

The #Name error occurs when you use a function within a formula that Excel doesn't recognize. Make sure in the formula that uses your UDF that the UDF is spelled correctly (case doesn't matter).
 
Upvote 0
OK, I decided to have another look at this today. I copied the function and pasted it in as before. I copied the formula to use as before. Changed the formula to ensure the name was the same as in the function (as before). This time I got a picture! I did nothing different!?

Now, If I put the formula in like this
=showpicD("L:\spreadsheets 8CSk\cup.wmf")
it works

But I want it to be the result of an IF function so I changed the formula to
=IF(E13=10,showpicD("L:\spreadsheets 8CSk\cup.wmf",""))
While E13 <> 10 I have FALSE showing but as soon as E13=10 I get the error message #VALUE!
The MS excel note attached to the cell says, "A value used in the formula is of the wrong data type."

Can you spot the mistake I must be making?
 
Upvote 0
I made a blank pic and it now works fantastic.
This is a great forum!
I have always found forums to be the best place to get help no matter what.
Thanks everyone.
Now how do I mark this as solved?
 
Upvote 0
Um - just discovered that if I protect the sheet, the pictures can't change.
I've tried unlocking the pictures - but as soon as I lock the sheet and try it - I find it doesn't work. When I unlock the sheet again, I discover that the pictures are locked again.
Anyone know how to deal with that?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,602
Members
449,089
Latest member
Motoracer88

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