Theme apply on Microsoft Excel Web Addin.

Dipanjan Tripathi 20 Reputation points
2025-08-21T12:58:35.1466667+00:00

I want to build a features which will fetch 4/5 theme details from a backend and when user will click on a particular colour palate then the theme should be applied on the current workbook. I was trying to apply the theme in current workbook but observed there are no such api exist in office.js to perform this operations. Is there any other way to achieve this functionality or if office.js have any exposed api that can be used in this case?

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

Accepted answer
  1. Flora-T 3,200 Reputation points Microsoft External Staff Moderator
    2025-08-21T15:09:17.1566667+00:00

    Dear Dipanjan Tripathi

    Welcome to Microsoft Q&A Forum.  

    Thanks for reaching out and sharing clear scenario. I totally get what you’re aiming for: let users pick a palette from your service and have the workbook update. 

    Unfortunately, as you observed, there isn’t currently an Office.js API to read or set the workbook’s Theme or Theme Colors in-place. Office Scripts and the Excel REST APIs also do not provide a way to change the workbook theme. 

    However, you may consider a few workarounds: 

    Coordinate your add-in UI with the Office app theme 

    • Office.js only exposes the Office app’s UI theme via Office.context.officeTheme and Office.onOfficeThemeChanged so your task pane matches Light/Dark and accent colors. 

    Simulate a “theme” in the workbook by applying consistent formatting yourself 

    • Update built-in cell styles (Normal, Heading 1–6, Title) so users see your palette as they work. 
    • Standardize table styles and recolor header/body ranges. 
    • Recolor chart series and titles/axes to your palette. 
    • Format shapes (fills/lines) and, if relevant, PivotTables and slicers. 

    Note: This provides a consistent look, but it does not change the underlying Theme/Colors in Page Layout. Existing and future content won’t auto-recolor in the same way a true theme change would. 

    While this Q&A forum is a valuable space for sharing insights and receiving technical guidance, the most effective way to influence product development is by submitting feedback directly to Microsoft. You can do this via Help > Feedback in the Excel app or through the Excel Feedback Portal.

    At Microsoft, accessibility and user experience are top priorities, and feedback like yours plays a crucial role in shaping future improvements.


    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. 


0 additional answers

Sort by: Most helpful

Your answer

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