Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a macro (made for Excel - Windows), which url encode strings - i.e. space becomes %20. When I open the *.xlsm on a Mac with Excel installed(Office for Mac 2011), it does not work. No errors - nothing!! I found this from googling - http://blog.mclaughlinsoftware.com/2010/11/04/excel-2011-without-udfs/ I have tried re-installing as described in the link above with no success. I can not even get the small "tests" to work as described.

Function hello()
  hello = "Hello World!"
End Function

Function hellowhom(nameIn As Variant)
  hellowhom = "Hello " + CStr(nameIn) + "!"
End Function 

And doing =hello() or =hellowhom(A1) in the formula builder.

Any hints or tips??

share|improve this question
    
What is the value in the cell after you enter =hello()? Did you make sure to put the functions in a Module (not the Worksheet/Workbook)? –  Zairja Aug 8 '12 at 13:29
    
The value is #NAME? after entering =hello(). And I have tried to move the functions into a Class module - it does not change anything... –  jens Aug 14 '12 at 8:09
    
ohh - just moved it into a MODULE ;o) and now it works!! Thx!!! @Zairja –  jens Aug 14 '12 at 8:58
    
I've added my comment as an answer which you may accept to "close" the question. :) –  Zairja Aug 14 '12 at 12:39
add comment

1 Answer

"The code for a UDF should be placed in a standard code module, not one of the Sheet modules and not in the ThisWorkbook module. In the VBA editor, go to the Insert menu and choose Module. This will insert a new code module into the project. A module can contain any number functions, so you can put many functions into a single code module. You can change the name of a module from Module1 to something more meaningful by pressing the F4 key to display the Properties window and changing the Name property to whatever you want."

-from Chip Pearson's great site

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.