Summarize All Comments and Notes in Excel
This process gathers every cell comment and note that is scattered through one or many Excel workbooks and consolidates them into a single, readable summary. For each workbook the bot makes a dated copy in an output folder, runs a VBA macro against the copy to harvest the comments and notes, and reports per-file success or failure back to the operator. The original workbooks are never touched, so reviewers can pick up the summary copies without any risk to source data.
At a glance
| Trigger | Manual, attended launch by a user from UiPath Assistant (the desktop launcher for automations). Three Assistant switches control the experience: Hide_Inputs, Hide_Messages, Hide_Results. |
| Frequency | On demand. Not recorded in the source. |
| Systems used | Microsoft Excel desktop (Office 16.0); Windows file system; Windows registry (HKCU\Software\Microsoft\Office\16.0\Excel\Security, value AccessVBOM); local settings file in MyDocuments; UiPath Orchestrator assets (optional); default web browser (user guide); default email client (error reporting) |
| Inputs | Mode choice — single workbook or whole folder; the workbook path or folder path; the output folder path; project defaults from Data\Supporting\Config.json; previous-run settings from MyDocuments\UiPath Configs - Do Not Delete\[project name]\Run Config.json |
| Outputs | One summary workbook per input file, named <original name> - Notes and Comments MM.dd<original extension>, in the output folder; an on-screen results form with totals and a per-file result table; refreshed Run Config.json; exception screenshots; execution logs |
| Typical run | Not recorded in the source (no volume or duration information available) |
| Owner | Not recorded in the source |
Before you start
- Access to a Windows desktop with Microsoft Excel installed. The registry path the bot manipulates is hard-coded to Office version
16.0; other versions are not addressed in the source. - Read access to the source workbooks and write access to the output folder you intend to use.
- "Trust access to the VBA project object model" must be available. The bot tries to turn this on for you by writing to the registry, but the developer warns: "If UiPath doesn't have admin rights this step may fail and the user will need to enable this manually (a one-time process) in Excel. Please reference the user guide." In Excel this setting lives under File → Options → Trust Center → Trust Center Settings → Macro Settings.
- The macro file must be present in the automation package:
Continue_Workflows\Extract Comments and Notes.vb, entry pointExtractNotesAndComments. - A writable MyDocuments folder. The bot creates and maintains
MyDocuments\UiPath Configs - Do Not Delete\[project name]\Run Config.json. Do not delete this folder — it stores your last-run selections. - Optional: Orchestrator connectivity. If
Data\Supporting\AssetConfig.jsonlists any shared settings ("assets") to be pulled from the central UiPath server, connectivity is needed; if it fails the run continues with a warning. - Decide your Assistant switches before launching:
| Switch | Effect when checked |
|---|---|
Hide_Inputs |
Skips the input form and silently reuses the previous run's selections and the last button pressed. Overridden on the first run of a newly published version. |
Hide_Messages |
Suppresses the small floating progress window. |
Hide_Results |
Suppresses the final results form — you will not get the option to repeat the run. |
Procedure
Stage 1 — Load configuration
- Read the project name and version from the automation's own
project.json. - Look for the saved settings file at
MyDocuments\UiPath Configs - Do Not Delete\[project name]\Run Config.json.- If it exists, load it as this run's settings, so the input form is pre-filled with last time's choices.
- If it does not exist, create the folder structure (
UiPath Configs - Do Not Delete, then a sub-folder named after the project) and build the settings from the packaged defaults inData\Supporting\Config.json.
- Compare the stored project version against the current one. If they differ (or the comparison fails), flag this as a "first run" — this forces the input form to appear even when
Hide_Inputsis checked. - If the user-guide URL setting (
userGuideUrl) is blank, substitute the text"No user guide link available". - If
Data\Supporting\AssetConfig.jsonexists, fetch each named setting from Orchestrator and merge it into the run settings. A retrieval failure is logged as a Warning only and the run continues. - Any failure in this stage is treated as a technical (system) exception and takes the run straight to the error results form — see Exceptions and recovery.
Stage 2 — Start the progress window
- Unless
Hide_Messagesis checked, a small always-on-top progress window opens alongside the main process. It listens on a named internal message channel (settingstatusWindowChannel) and displays whatever text the process broadcasts to it. - Initial text is
"Welcome to your UiPath automation". - If the operator closes this window by hand, message handling stops and the run continues silently. The internal message
EndProcesscloses it at the end of the run.
Stage 3 — Collect the operator's selections
- The bot minimises the UiPath Assistant window so the forms are visible.
- Decision — show the form or not?
- If
Hide_Inputsis checked AND this is not the first run of this version: the form is skipped entirely. The bot logs"User Inputs form hidden, using previous inputs"and immediately runs the process associated with the button pressed on the last run. - Otherwise: the input form is displayed, pre-populated from the saved settings.
- If
- On the input form the operator sets:
- the mode — single workbook (
selectType=singleExcelFile) or whole folder; - the workbook path (
selectFile) or the folder path (excelFolder); - the output folder (
outputFolderPath).
- the mode — single workbook (
- Buttons identifiable in the source: Cancel, view user guide, and a submit/continue button that starts the extraction. (The full button inventory is not visible in the source.)
- If "view user guide" is pressed, the URL held in
userGuideUrlopens in the default browser. If it cannot be opened, the URL text is pushed into the progress window instead so the operator can copy it. - If Cancel is pressed, or the form is closed with the "X", a cancelled flag is set,
"Ending process from Form cancellation"is logged, and the run ends without processing anything.
- If "view user guide" is pressed, the URL held in
- When a submit button is pressed,
"Process started"is broadcast to the progress window. If the window is not yet drawn (common when the input form was hidden), the broadcast is retried once with a three-second allowance.
Stage 4 — Build the workbook list
- If
selectType=singleExcelFile:- Broadcast
"Processing single Excel file". - Add the one path held in
selectFileto the work list. - Broadcast
"Aggregating comments and notes for a single file — Please wait...".
- Broadcast
- Otherwise (folder mode):
- Broadcast
"Processing multiple Excel files". - List every file directly inside the folder named in
excelFolder. - Keep only files whose names contain
.xlsx,.xlsor.xlsm. Anything else is logged as"<filename> excluded"and ignored. - Broadcast
"Aggregating comments and notes for multiple files — Please wait...".
- Broadcast
- If the work list is empty, stop: the bot raises a business exception using the configured message text held under the key
NoExcelFiles.
Ambiguity to note: the flow-chart ordering in
Process.xamlis not fully resolvable from the outline. The empty-list check and the "enable macros" registry step appear explicitly only on the single-file branch. Treat the empty-list check and the registry enable as applying to both branches, but verify against the live process if you are rebuilding it.
Stage 5 — Enable programmatic access to Excel VBA
- The bot runs a command-line registry write:
REG ADD HKCU\Software\Microsoft\Office\16.0\Excel\Security /v AccessVBOM /t REG_DWORD /f /d 1 - This is the machine equivalent of ticking "Trust access to the VBA project object model" in Excel's Trust Center, and it is required before the extraction macro can be injected into a workbook.
- Developer note: "This code snippet changes the registry key so Excel can run VBA macros." If UiPath is running without sufficient rights the write can fail silently here and surface later as a "Visual Basic Project" error during processing.
Stage 6 — Copy and process each workbook
For every file in the work list, in order:
- Build the destination path:
<outputFolderPath>\<original file name without extension> - Notes and Comments <MM.dd><original extension>(MM.ddis today's month and day.) - Copy the source workbook to that destination, overwriting any file already there with the same name.
- Broadcast
"Processing Excel workbook #n — Please wait..."(n counts from 1). - Open the copy in Excel with auto-save off, and run the macro
ExtractNotesAndCommentsfromContinue_Workflows\Extract Comments and Notes.vbagainst it. Log"Comments and Notes extracted". - Broadcast
"Finished Excel workbook #n". - Increment the success counter and add a row to the per-file results table: file name plus
"Successfully processed". - If anything fails for this workbook:
- If the error message contains
"Visual Basic Project", the run stops with a business exception using the configured text under keyNoVBAAccess— the operator must enable VBA project access in Excel manually. - Otherwise: the half-finished copy at the destination path is deleted, the failure is logged, and a results-table row is added with the file name and the error message. The loop continues to the next workbook — one bad file does not abandon the batch.
- If the error message contains
The original workbooks are never opened for writing at any point.
Stage 7 — Compile results
- Convert the per-file results table into the grid displayed on the results form (setting
resultGrid). - Set the base result message to
"Your automation has completed!"and append:Total Excel workbooks: <count of files in the work list>Successfully processed: <success counter>
- Turn on the "View output" button flag so the results form offers a shortcut to the output folder.
Stage 8 — Disable programmatic access to Excel VBA
- The bot runs the reverse registry write:
REG ADD HKCU\Software\Microsoft\Office\16.0\Excel\Security /v AccessVBOM /t REG_DWORD /f /d 0 - Developer note: "This code snippet changes the registry key so Excel macros are disabled." This returns the machine to its locked-down state so the elevated trust does not persist between runs.
Stage 9 — Persist settings, then show results and offer a repeat
- Broadcast
"Process complete"to the progress window. - If this was flagged as a first run, set the first-run flag to False so that future runs with
Hide_Inputschecked will skip the form. - Overwrite
MyDocuments\UiPath Configs - Do Not Delete\[project name]\Run Config.jsonwith the current settings, so the next run is pre-populated. Developer note: "This allows the configuration from the last successful execution to be saved and prepopulated on the next run." - If
Hide_Resultsis not checked, display the results form showing the summary message, the per-file grid, a View output button (opens File Explorer atoutputFolderPath) and a Repeat process button. - If the operator presses "Repeat process": exception state and internal flags are reset and the input form is shown again from Stage 3. Otherwise the run proceeds to close down.
- If
Hide_Resultsis checked, no form appears and the operator gets no opportunity to repeat.
Stage 10 — Close down
- Broadcast
EndProcessto close the progress window and finish.
Exceptions and recovery
| Condition | What the automation does | What a human should do |
|---|---|---|
| Configuration cannot be loaded or built at start-up | Logs at Fatal level; creates an empty settings dictionary if needed purely so the error form can render; shows the error results form. If the operator does not press "Repeat process", re-throws as "Init Error - ..." and the run ends. |
Developer note says the user cannot resolve this themselves. Check that MyDocuments is writable and that Data\Supporting\Config.json is present and valid JSON; escalate to the automation owner. |
Folder listing fails in folder mode (invalid or inaccessible excelFolder) |
The error is logged at Fatal level and then suppressed — no exception is raised at that point. The work list simply stays empty, so the operator sees the NoExcelFiles business message (or nothing) rather than the real cause. |
Check the execution log for the Fatal entry to find the true error, then verify the folder path is correct, exists, and that you have permission to read it. Re-run. |
| No Excel workbooks found for the selection | Raises a business exception using the configured message under key NoExcelFiles; the error results form is shown. |
Confirm the folder path is correct and contains .xlsx, .xls or .xlsm files, or that the single-file path exists. Re-run. |
Excel refuses programmatic access to the VBA project (error text contains "Visual Basic Project") |
Converts the failure into a business exception using the configured message under key NoVBAAccess. |
In Excel: File → Options → Trust Center → Trust Center Settings → Macro Settings → tick "Trust access to the VBA project object model". This is a one-time change. See the user guide. |
| A single workbook fails during copy or macro execution | Deletes the partial copy at the destination, logs the failure, records file name + error message in the per-file results table, and continues to the next workbook. | Read the per-file grid on the results form. Investigate the named workbook (protected, corrupt, open elsewhere, password-protected) and re-run it on its own in single-file mode. |
Any other business-rule failure during form completion or processing (including a generic error whose text contains "Business Exception") |
Logged at Error level with business-process log fields; error results form shown; re-thrown as "Processing Error - ..." unless the operator repeats. |
Read the message on the form, correct the underlying data or selection, then repeat or re-launch. |
| Any other technical failure | Logged at Error level; a full-screen screenshot is saved as ExceptionScreenshot_yyMMdd.hhmmss.png in the folder from setting exScreenshotsFolderPath (a screenshot failure itself only logs a Warning); error results form shown; re-thrown as "Processing Error - ..." unless the operator repeats. |
Use the "email the error" button on the form, attach the screenshot, and escalate. |
| Operator wants to report an error | The error results form offers a button that opens the default mail client with a draft addressed to the setting errorEmailRecipient, subject <business process name> <error type>, body = the error message. |
Send it, adding what you were doing and which workbook(s) were involved. |
| Operator cancels the input form or closes it with "X" | Sets a cancelled flag, logs "Ending process from Form cancellation", ends without processing. |
Nothing. Re-launch when ready. |
| User-guide link cannot be opened | Broadcasts the URL text into the progress window instead. | Copy the URL from the progress window and open it manually. |
An Orchestrator asset named in AssetConfig.json cannot be retrieved |
Logs a Warning "Loading asset X failed: ..." and continues without it. |
Usually harmless. If behaviour looks wrong, check Orchestrator connectivity and the asset name/folder in AssetConfig.json. |
| Progress window not yet drawn when processing starts (typical when the input form was hidden) | Retries the "Process started" broadcast once with a three-second allowance, per developer note. |
Nothing. |
Registry write for AccessVBOM fails (insufficient rights) |
No dedicated handler; the consequence appears later as the "Visual Basic Project" error above. | Enable the Trust Center setting manually, or run with the rights needed to write to HKCU. |
Data handled
| Name | What it holds | Where it comes from |
|---|---|---|
dict_Config / io_dict_Config |
The single run-settings bundle passed to every part of the automation — file paths, mode choice, message texts, flags, result text. | Built at start-up from Run Config.json (if present) or Data\Supporting\Config.json, then merged with Orchestrator assets and updated by the input form. |
selectType |
singleExcelFile for one workbook; any other value means folder mode. |
Input form |
selectFile |
Full path of the single workbook to process. | Input form |
excelFolder |
Folder whose .xlsx/.xls/.xlsm files will all be processed. |
Input form |
outputFolderPath |
Where the dated summary copies are written; also the folder opened by the "View output" button. | Input form / config |
list_excelFilesList |
The working list of workbook paths for this run. | Stage 4, from selectFile or the folder listing |
str_newFilePath |
Destination path of the current copy: <outputFolderPath>\<name> - Notes and Comments MM.dd<ext>. |
Computed per workbook |
dt_resultGrid / resultGrid |
One row per workbook: file name and either "Successfully processed" or the error message. Displayed on the results form. |
Built during Stage 6 |
resultFormMessage |
The text shown on the results form — "Your automation has completed!" plus total and success counts. |
Stages 7 and 4 |
NoExcelFiles, NoVBAAccess |
Configured wording for the two business-rule failure messages. | Data\Supporting\Config.json |
userGuideUrl |
Link opened by the "view user guide" button; replaced with "No user guide link available" if blank. |
Config |
errorEmailRecipient |
Support address used in the pre-filled error email. | Config |
exScreenshotsFolderPath |
Folder where exception screenshots are saved. | Config |
statusWindowChannel |
Name of the internal message channel used to push progress text to the floating window. | Set during initialisation |
firstRun, formCanceled, repeatProcess, showViewOutput |
Control flags: force the form on a new version; operator cancelled; operator asked to repeat; show the "View output" button. | Set during the run; firstRun persisted in Run Config.json |
Hide_Inputs, Hide_Messages, Hide_Results |
Operator-set switches controlling whether the input form, progress window and results form appear. | UiPath Assistant at launch |
AssetConfig.json entries |
Names of shared settings to pull from Orchestrator, each with an asset name and an Orchestrator folder. | Data\Supporting\AssetConfig.json, maintained via the ConfigUtility form |
Not determinable from the source
- What the
ExtractNotesAndCommentsmacro actually writes — target sheet name, layout, and whether comments are consolidated onto one new sheet or listed per source sheet. Only the.vbfile path and entry-point name are visible. - Default values for
outputFolderPath,selectFileandexcelFolder— these live inData\Supporting\Config.json, which is not included. - The literal wording of the configured messages
NoExcelFilesandNoVBAAccess. - The support email address in
errorEmailRecipientand the user-guide URL inuserGuideUrl. - Typical run volumes (workbooks per run) and expected runtime.
- Who owns the output folder, who consumes the summary workbooks, and any downstream process or retention rules.
- Whether this is ever run unattended or on a schedule; only attended launch from UiPath Assistant is visible.
- The full inventory of input-form buttons — only Cancel, "view user guide" and one submit/continue button are identifiable.
- Whether Office versions other than 16.0 are supported; the registry path is hard-coded.
- The precise flow-chart ordering in
Process.xamlbetween the folder branch and the enable/disable-macros registry steps.
How this SOP was checked
Generated from the project's source files and audited against them. Audit verdict: minor issues, confidence high.
Core business process is recovered accurately: config load from Run Config.json/Config.json, optional Orchestrator assets, input form gating by Hide_Inputs + firstRun, single-file vs folder list build with extension filter, AccessVBOM registry enable/disable, per-workbook dated copy into outputFolderPath, VBA macro ExtractNotesAndComments on the copy, per-file result grid, results form with View output / Repeat process, and the exception routes (Init/Processing/Business, NoExcelFiles, NoVBAAccess, screenshot, mailto error email). Values, paths, thresholds and message texts match the source. Genuinely unsupported items (macro output layout, config defaults, volumes, owner) are correctly flagged. Gaps: the Picture-in-Picture branch, the swallowed exception in the folder-listing workflow, the ConfigUtility design-time utility, and the true position of the Save Config block.
2 corrections from the audit were applied to the procedure above.
Remaining minor notes, not corrected:
- Stage 7, step 2 and Data handled → resultFormMessage — The assign of "Your automation has completed!" is a separate flow step in Process.xaml whose position relative to Invoke CreateLinks is not resolvable from the outline (as listed it appears after CreateLinks, which appends the totals). The SOP states definitively that the base message is set first and then appended, and the data table sources resultFormMessage to 'Stages 7 and 4' (Stage 4 never sets it). (State that CreateLinks appends 'Total Excel workbooks' and 'Successfully processed' to the existing message, and that the placement of the "Your automation has completed!" assign in the flow chart is ambiguous in the source; fix the data-table reference to Stages 6/7 plus initialisation default.)
- Stage 3 / Data handled (missing element) — Picture-in-Picture execution is omitted. Main.xaml sets a 'pip' flag during initialisation, and DisplayInputForm.xaml invokes FormButtonAction in a child session when pip is true (main session otherwise). (Note that the automation records whether it was started in UiPath's Picture-in-Picture (isolated desktop session) and, if so, runs the button's process in that child session; Excel work then happens in the isolated session.)
- Stage 2, step 1 ('always-on-top progress window') — 'Always-on-top' is not supported by the outline; the status-window code only sets MaximizeBox=False, ShowIcon=False and a label control. (Describe it as a small floating status window that displays broadcast text; drop the always-on-top claim.)
- Stage 1, step 3 (version compare / firstRun) — The version comparison and firstRun=True assignment appear in the outline only at the end of the branch taken when Run Config.json did not exist; the SOP presents it as a step that always runs after loading settings. (Keep the behaviour but note the source places the projectVersion comparison in the config-creation/update branch, so its application on the 'existing Run Config' path is inferred, not explicit.)
- Coverage — ConfigUtility.xaml — The ConfigUtility workflow (form-driven editing of Config.json and AssetConfig.json, deletion/rewrite of AssetConfig.json, reset from 'ConfigUtility - Backup.json' with Yes/No confirmation and 'Please rerun the ConfigUtility workflow' prompt) is only mentioned in passing in the data table. (Add a short appendix stating it is a design-time/maintenance utility, not part of the runtime process, and list what it writes.)
- Before you start, item 3 (Trust Center menu path) — The File → Options → Trust Center → Trust Center Settings → Macro Settings path is not in the source; only the registry command and the developer's 'enable this manually … reference the user guide' note are. (Mark the menu path as general Excel guidance, or cite the user guide as the source per the developer note.)