View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Donal McWeeney Donal McWeeney is offline
external usenet poster
 
Posts: 11
Default Cannot get vba function to execute

I had a excel file with a custom vba function that worked fine.

I upgraded to 2007 and saved the file as a macro enabled workbook (.xlsm)
and cannot get the custom function to get called - it keeps displaying as a
#NAME? error.

In the Macro Settings "Enable all macros..." is enabled and "trust access to
the VBA.." is set.

The file is on a share and that share is added as a "Trusted Location"

The formula is listed in the user defined formula section of the insert
formula dialog.

The formula is in a module as follows:

Option Explicit

Public Function DoCalculate() As Single

DoCalculate = 1000

End Function

and is being called as follows: =DoCalculate()

Any help greatly appreciated

Thanks

Donal