Today I was working on a macro-enabled Excel workbook and tried to use the old familiar Nz() function and got Compile error: Sub or Function not defined. That means the reference isn’t added into the Excel project by default. To fix this, add the reference for “Microsoft Access 15.0 Object Library” if using Office 2013 (or Office 365).