Trouble Running Office.js Add-in Due to Error Code 13002

Andrus Shirnavana 100 Reputation points
2025-12-11T12:16:43.6566667+00:00

I’m working on an Office.js add-in and keep running into error code 13002: “The domain of the add-in manifest is not trusted” whenever I try to load it in Excel desktop. I’ve already added my localhost URL to the trusted catalog and checked that the manifest points to the correct HTTPS endpoint, but the add-in still refuses to load. I’m not sure whether this is a runtime permission issue, a sideloading restriction, or something related to the WebView runtime on Windows.

Microsoft 365 and Office | Development | Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Q&A Assist
    2025-12-11T12:16:54.96+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    Error code 13002 typically indicates that the user aborted the sign-in process or consent by choosing Cancel on the consent dialog. To address this issue, you should ensure that your add-in provides functions that can operate without requiring the user to be signed in or having granted consent. If your add-in does require a signed-in user, you should implement a sign-in button that appears when this error occurs.

    Additionally, confirm that the domain specified in your add-in's manifest matches the domain of the add-in itself. If the <Resource> element in the <WebApplicationInfo> section of your manifest is not configured correctly, it may also lead to this error. Make sure that the protocol part of the Resource value is set to "api" and that all other parts of the domain name (including port, if any) are the same as for the add-in.

    If you have already added your localhost URL to the trusted catalog and ensured that the manifest points to the correct HTTPS endpoint, double-check the manifest configuration for any discrepancies or errors that might be causing the issue.

    0 comments No comments

  2. Gabriel-N 9,875 Reputation points Microsoft External Staff Moderator
    2025-12-11T15:07:32.1+00:00

    Dear Andrus Shirnavana

    Thank you for posting your question on the Q&A forum.

    Based on the details you shared, here are some suggestions based on my research:

    1> Match Domains Exactly: If you’re running on https://localhost:3000 but your code loads or redirects to https://localhost:3000/login.html (or another port/subdomain), Office may treat it as untrusted unless the exact domain is listed in the <AppDomains> section of your manifest.xml. Please ensure all development domains are included there.

    2> Trust Your Development Certificate: If you’re using a self-signed certificate for localhost that isn’t in the Windows Trusted Root Certification Authorities store, Office will block the page.

    • If your add-in was scaffolded with Yeoman (yo office), run:  npx office-addin-dev-certs install (or --machine for system-wide trust). Approve the prompt to add the cert to the trusted store.
    • If not using Yeoman, you can manually create and trust a cert via PowerShell: New-SelfSignedCertificate -DnsName "localhost" -CertStoreLocation "cert:\CurrentUser\My" Export the cert and import it into Trusted Root Certification Authorities using certmgr.msc. Update your dev server to use this cert, then restart Excel.
    • Verify by opening https://localhost:<port> in Edge or Chrome, if no warning appears, the cert is trusted.

    3> Switch to WebView2: If you want to use the modern runtime:

    • Install the WebView2 Evergreen Runtime from Microsoft Edge WebView2.
    • Set the registry key:
    HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Wef\Developer
    UseWebView2 (DWORD) = 1
    

    4> Catch and Log Errors: Consider wrapping calls like OfficeRuntime.auth.getAccessToken({ allowConsentPrompt: true }) with error handling and logging for better diagnostics.

    References:

    Office Add-ins manifest

    Sideload Office Add-ins for testing from a network share - Office Add-ins | Microsoft Learn

    Microsoft Edge WebView2 and Microsoft 365 Apps

    Hope this helps!


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


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.