+ Reply to Thread
Results 1 to 2 of 2

#NAME Error with Function Defined with Public Function

Hybrid View

  1. #1
    Registered User
    Join Date
    01-14-2009
    Location
    Worcester, England
    MS-Off Ver
    Excel 2007
    Posts
    19

    #NAME Error with Function Defined with Public Function

    Hi All.

    I've defined a function to display the Category from properties as follows:

    Public Function Version() As String
       Application.Volatile
       Version = _
           ThisWorkbook.BuiltinDocumentProperties("Category")
    End Function
    I've put a formula into a worksheet to display this value (in this case the version number) which is

    ="Pricing Tool "&Version()
    This works fine on my laptop, however if anyone else views the file they get a #NAME error in the cell where the formula is. I was thinking that perhaps the code needed to be loaded when the file opens, can anyone advise how this would be done as using the public function with workbook_open doesn't seem to work. Ant other suggestions also welcome of course.

    Thanks

    Simon

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,971

    Re: #NAME Error with Function Defined with Public Function

    Where did you put the code? In the workbook, or in another workbook such as your personal macro workbook? If it's in the workbook, then it may be that the others simply have macros disabled.
    Everyone who confuses correlation and causation ends up dead.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1