Skip to main content

Error: 'Compile Error: User-defined type not defined' when opening spreadsheet report

What to do if you see a compile error message when trying to open a spreadsheet report in DeltaWMS.

Tom Higgs avatar
Written by Tom Higgs
Updated this week

Overview

If you see the error message 'Compile Error: User-defined type not defined' when trying to open a spreadsheet report, this usually indicates a missing reference in the spreadsheet's VBA code. You can resolve this by checking and updating the references.

Check and update references

To fix this error, follow these steps:

  1. Open the VBA Editor by pressing Alt + F11 on your keyboard.

  2. Click Tools, then click References.

  3. Look for any references marked as MISSING.

  4. If you find a missing reference, clear its checkbox, then click OK.

You should now be able to open and run the spreadsheet as normal.


Re-register the WinSCP.dll file

If the issue continues after checking references, the Excel file may be corrupted or the WinSCP.dll file may need re-registering. Contact your internal IT team and ask them to follow these steps:

  1. Click the Start menu.

  2. Type cmd, then right-click Command Prompt.

  3. Select Run as administrator.

  4. Locate your WinSCP folder (commonly in C:\Program Files (x86)).

  5. Execute these commands:

%WINDIR%\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe WinSCPnet.dll /codebase /tlb:WinSCPnet32.tlb
%WINDIR%\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe WinSCPnet.dll /codebase /tlb:WinSCPnet64.tlb

Still need help?

If these steps don't resolve the issue, contact our Support team. When you raise your case, include:

  • The title of this article.

  • The name of the affected spreadsheet report.

  • The exact error message you can see

Did this answer your question?