ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   issue with concatonating string exporting to excel through C# (https://www.excelbanter.com/excel-programming/341160-issue-concatonating-string-exporting-excel-through-c.html)

R.E.E. Developer

issue with concatonating string exporting to excel through C#
 
Hello, and thank you in advance for your support.
I am trying to export a string to Excel in my C# program, which contains
multiple font formats. My string is 1/2 static and 1/2 dynamic with the font
formatting in the static portion. I need to have the string display as
follows,
(static)Communities include[superscript](1)[/superscript]: (dynamic)
community1,community2,etc.

The string must be contained in a single cell centered on the report.
I have tried writing the static portion to a single cell in excel, and using
an * after that. Then calling the range.Replace() function. The arguments for
this function are listed as 2 required and the rest optional, but using
Visual C# .NET, my compiler is requiring me to supply every argument, which
then gives me an error in my excel generator.

I have searched for an append function in the excel namespace, but to no
avail. I also tried the excel.WorksheetFunction.Substitute() function, but my
program is requiring 4 arguments: 3 strings, and one object. Every reference
I can find requires only 3 arguments, which confounds me. Any help would be
much appreciated, and once again, thank you for your assistance.

Brandon Schoen
Real Estate Economics


All times are GMT +1. The time now is 06:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com