I have a OneNote note that has an embedded Excel spreadsheet. The worksheet has code that is run by formulae in the worksheet. It works fine if the worksheet is opened from Excel, but if I run it when embedded in OneNote, I get ‘?NAME’ errors.
I have looked at permissions in Excel, but nothing seems to cure the problem.
In more detail:
I have a spreadsheet for astrophotography that calculates the Altitude and Azimuth of a star (the position in the sky as viewed from a specific location) from the RA/Dec astronomical position and the time of day. I wrote an Excel vba function to do the calculations.
I then insert the function into a cell in the worksheet and it displays a table of positions against time. It works well, from Excel, but as soon as I embed the sheet in a OneNote note, select edit, then recalculate the sheet, I get ‘?NAME’ errors in all the cells that contain the function.
I guess it’s related to permissions, but I can’t figure out the solution.
I set macro permissions in Excel to accept code from my local disk, but that didn’t help.
Has anyone got any ideas? I can post an example sheet, if that helps?
Pete
Screenshots:
Before:
After: