0

Are there any ways to make the text bold without using the Excel.run method in a custom function?

I found how to format the numbers, but I could not find the formatting of the strings https://learn.microsoft.com/en-us/office/dev/add-ins/excel/custom-functions-data-types-concepts

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
Artem Ga
  • 5
  • 1
  • What do you mean `without using the Excel.run method in a custom function`. My functions take `context` as a param for example, is that what you mean? – FreeSoftwareServers Nov 02 '22 at 21:20
  • I use this to format my `rng` --> `XL_Formatting.Do_Format_Rng_Blue_White_Bold = async function Do_Format_Rng_Blue_White_Bold(context, rng) { rng.format.fill.color = Formats_Obj.fill.color.blue rng.format.font.color = Formats_Obj.font.color.white rng.format.font.bold = Formats_Obj.font.bold return context; }` – FreeSoftwareServers Nov 02 '22 at 21:22

1 Answers1

0

It is not possible to set the text to bold etc using the formatted number value data type. You can however call the Excel API and set the formatting on the cell that called the custom function. Access to the Excel API from a custom function require the use of the shared runtime.

The ability to apply additional formatting to formatted number value data types is a great feature request. Consider posting this as an item for the backlog in the Microsoft 365 Developer Community.