Forum Discussion
JGB82
Jan 11, 2023Copper Contributor
UDF not working in Excel 365
I have made a new funcion via VBA and put it in its own module, so not in the workbook or something, I made a new module.
It's a function for giving back the background color code of a selected cell.
I have tried it in Excel 365 but it's not working. I can call upon the function but it always gives back #name.
I know the VBA function is correct because I have also tried it in excel 2016 and it's working like a charm there.
Does anyone know why the function is not working in 365?
I really appreciate all the help I can get!
BTW this is the function:
Function NumColor(cell As Range)
NumColor = cell.Interior.Color
End Function
20 Replies
Sort By
- JGB82Copper ContributorThank you so much all of you! It seems to work now!
Really really thank you!!!
BTW if I share this file on Sharepoint do the formulas still work? I saw someone mentioning Macros don't work online? - JGB82Copper Contributor
I'm in a desktop version of excel 365 but this is what I get:
- Riny_van_EekelenPlatinum Contributor
JGB82 Looks like you have disabled macro's in Trust settings (don't know how that's called in NL Excel). when I disable it and reopen the file I get the NAME error.
Are you sure that you created the module in the workbook where you want to use the UDF?
- JGB82Copper Contributor
HansVogelaar No I made a new module. I did it the exact same way in excel 2016 and it's working there. Even if I e-mail the 2016 version to myself and open it in 365 it stops working.
- JGB82Copper Contributor
These are my settings for allowing Macro's.
I have also tried accepting all Macro's but that doesn't change anything.