VBA Code Repair for Excell

Kathleen Moore 0 Reputation points
2026-05-14T21:38:06.13+00:00

Trying to create a QuickBooks certified payroll report that is opened in Excel. We have been able to pull these reports until we updated QuickBooks today as requested by QuickBooks. The following error comes up:

Compile error in hidden module: cpInterview.

I need the correct VBA code in Excell to open these reports. Can you please provide a repair?!

Microsoft 365 and Office | Excel | Other | Windows
0 comments No comments

2 answers

Sort by: Oldest
  1. Marcin Policht 113.6K Reputation points MVP Volunteer Moderator
    2026-05-14T22:18:19.04+00:00

    This doesn't look like a “missing VBA code” problem. “Compile error in hidden module: cpInterview” likely means Excel is trying to load a QuickBooks/Intuit payroll add-in (or template macro module) that was compiled for a different Excel version, is missing a required library reference, or is being blocked after the QuickBooks update. Because the module is hidden, you cannot repair it by editing the workbook code directly in most cases.

    After QuickBooks updates, a common cause is that the Certified Payroll Excel export template or the cpInterview add-in is incompatible with your current Office build (32-bit vs 64-bit Excel, or an Office update that broke a referenced library).

    The actual repair is usually to stop Excel from loading the broken module and then reinstall or re-register the QuickBooks Excel export components.

    First, try opening Excel without any QuickBooks add-ins loading, then re-save or regenerate the report from QuickBooks. You can also force Excel to open a file while disabling macros so the broken module does not compile:

    Application.AutomationSecurity = msoAutomationSecurityForceDisable
    Workbooks.Open Filename:="C:\Path\YourReport.xlsm"
    

    If the file opens with macros disabled, that confirms the problem is inside the QuickBooks macro module, not your workbook structure.

    The actual fix is typically removing the QuickBooks add-in/template and reinstalling it or repairing Office references. In Excel, you'd go into VBA editor (Alt+F11), then Tools > References, and look for anything marked “MISSING”. If you see a missing library, unchecking it and repairing Office usually resolves the compile error.

    If the issue started immediately after updating QuickBooks, reinstalling the QuickBooks Desktop Payroll components (or the Certified Payroll Excel reporting tool) might fix the issue.


    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin

    Was this answer helpful?

    0 comments No comments

  2. Fallcom 5 Reputation points
    2026-05-27T20:50:53.6966667+00:00

    The answer by Marcin Policht may be wrong. I had this same error and went through a TON of things trying to fix it. It took several days, but I finally found the simplest fix for it. Hopefully it also works for you.

    The Compile error in hidden module cpInterview was misleading in my case because it reports as a compile error rather than an access-denied error. The fix for me ended up being to go to the Trust Center Settings in Excel and change the ActiveX Settings from "Disable all controls without notification" to "Prompt me before enabling Unsafe for Initialization (UFI) controls with additional restrictions for Safe for Initialization (SFI) controls with minimal restrictions."

    The Trust Center can be found from going to File > Options, or if you have the Developer Tab enabled you can go there and click Macro Security. You can enable the Developer tab by going to File > Options > Customize Ribbon and then checking the box for the Developer Tab on the right column.

    Was this answer helpful?

    6 people found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.