How to Add Excel Comments to an SSRS Export Using Macros
Question details
The user needs to automatically add comments to specific cells in an Excel file exported from SSRS, pulling the text for those comments from another data column.

- Product
- Excel / SSRS
- Device & OS
- not provided
- Scenario
- A scheduled SSRS report exports data to Excel, and the user needs a non-legacy solution (moving away from SSIS and VBScript) to populate cell comments dynamically.
- Observed behavior
- SSRS does not natively support writing Excel cell comments on export, requiring a post-processing automation solution to read from a source column and add notes to a destination column.
Before applying any macro or automation script, prepare a sample workbook containing dummy data to safely test the logic without exposing confidential information.
Use a Post-Processing VBA Macro
Since SSRS does not natively output Excel cell comments, use a VBA macro to loop through the exported dataset, copying values from a helper column into the target cells as comments.
This solution assumes that you include the comment text in a separate helper column within your SSRS report. Once the Excel file is generated, the macro processes the file, adds the comments, and hides or removes the helper column.
Open your exported SSRS Excel file. Press 'Alt + F11' to open the Microsoft Visual Basic for Applications (VBA) editor.
Click 'Insert' from the top menu, then select 'Module' to create a blank script window.
Paste a VBA script that loops through your active rows. Use the '.AddComment' method on your destination cell and set its text property to the value of your source column.
Press 'F5' or click the 'Run' button. The macro will instantly populate the target cells with the corresponding notes from your helper column.

Automate Data Exports and Macros in WPS Office
WPS Spreadsheet offers robust VBA and macro support, making it simple to process automated SSRS exports and dynamically manipulate cell comments.
- 1. Download and Install WPS Office: Get WPS Office for free and install it on your machine to handle spreadsheet automation.
- 2. Open Your SSRS Export: Launch WPS Spreadsheet and open the .xlsx file generated by your SSRS schedule.
- 3. Access the Developer Tools: Navigate to the 'Tools' tab on the ribbon and click 'Developer' to access the VBA editor.
- 4. Apply Your Post-Processing Script: Insert your script to map the data columns into cell comments and execute it to instantly update the report.

Frequently Asked Questions
Can SSRS natively render cell comments in Excel?
No, SSRS natively formats data into grid cells but does not have a built-in property to convert data fields into Excel cell comments or notes during the export phase.
What is a modern alternative to VBScript for automating Excel files?
If you are moving away from VBScript, you can utilize Python (with libraries like openpyxl), Office Scripts, or Power Automate to handle post-processing of Excel files generated by SSRS.
How do I hide the helper column after adding comments?
If using a VBA macro, you can add a line of code such as `Columns("E").Hidden = True` (replace "E" with your column letter) at the end of your script so the raw comment data is no longer visible on the report.




