Error calling macro module from Workbook_NewSheet

Error calling macro module from Workbook_NewSheet

For several years I've used a sheet that calls a macro in a macro module from the ThisWorkbook module under Spreadsheet objects.

Earlier this week I adjusted an unrelated part of the macro module, and the call from the ThisWorkbook module stopped working. It now reports the macro module function as "Undefined function or value", instead of running it. So I set up a very simple test spreadsheet to figure out the problem, and I can't make it work there either.

Here is my test code, which doesn't work right now.

Code in Spreadsheet Objects > ThisWorkbook:

   REM ThisWorkbook Module

   Private Sub Workbook_NewSheet(ByVal sh As Object)
      TestFunction()
   End Sub

Code in Macro Modules > Macro:

   Sub TestFunction()
      ActiveSheet.Cells(1,1).Value = "'Test"
   End Sub

The error reported is "Undefined function or value: TESTFUNCTION" when it is called from Workbook_NewSheet(ByVal sh As Object)

I have also tried putting call in front of TestFunction(), removing the brackets (with or without call), changing the TestFunction() declaration to public, and some other variations as well - but what's here right now (with no call, and with the empty brackets) is what had been working before.

 Where is the problem?
    • Sticky Posts

    • What's new in Zoho Sheet: Simplify data entry and collaboration

      Hello, Zoho Sheet community! Last year, our team was focused on research and development so we could deliver updates that enhance your spreadsheet experience. This year, we’re excited to deliver those enhancements—but we'll be rolling them out incrementally
    • Introducing Forms in Zoho Sheet

      We hereby bring you the power of ​forms in Zoho Sheet. ​Now, build and create your own customized forms using Zoho Sheet. Be it compiling a questionnaire or rolling out a survey, Zoho Sheet can do it all for you. Forms is an excellent feature that helps you collect information in the simplest of ways and having it in Zoho Sheet takes it a notch higher. Build Simple yet Powerful forms Building forms using Zoho Sheet is fairly simple. The exclusive 'Form' tab lets you create one quickly. Whether you
    • Slicers are now available in Zoho Sheet—filter your data interactively

      At Zoho Sheet, we diligently track user requests and feedback. In line with this, based on extensive user requests, we've integrated Slicers to pivot tables and are delighted to announce its release. Slicers are interactive visual filters that have add,
    • Introducing Data Bars: Graphically represent changes in data within the cells

      Conditional formatting has helped millions of spreadsheet users analyze and highlight their data more efficiently. In addition to the classic rules, color scales, and icon sets available in Zoho Sheet, you can now apply Data Bars, a convenient method
    • Feature enhancement: Highlight rows based on a cell value

      Hello Sheet users, We're excited to announce a new feature enhacement, shaped directly by your valuable feedback! As you might know, conditional formatting is a great tool for anyone dealing with large data sets. Previously, if you’ve ever wanted to draw