Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9138127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:12:58+00:00 2026-06-17T09:12:58+00:00

I developed an Add-In for Excel so you can insert some numbers from a

  • 0

I developed an Add-In for Excel so you can insert some numbers from a MySQL database into specific cells. Now I tried to format these cells to currency and I have two problems with that.
1. When using a formula on formatted cells, the sum for example is displayed like that:
“353,2574€”. What do I have to do to display it in an appropriate way?
2. Some cells are empty but have to be formatted in currency as well. When using the same format I used for the sum formula and type something in, there’s only the number displayed. No “€”, nothing. What is that?
I specified a Excel.Range and used this to format the range

sum.NumberFormat = "#.## €";

But I also tried

sum.NumberFormat = "0,00 €";
sum.NumberFormat = "#.##0,00 €";

Any idea someone?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:12:59+00:00Added an answer on June 17, 2026 at 9:12 am

    This one works for me. I have excel test app that formats the currency into 2 decimal places with comma as thousand separator. Below is the Console Application that writes data on Excel File.

    Make sure you have referenced Microsoft.Office.Interop.Excel dll

    using System.Collections.Generic;
    using Excel = Microsoft.Office.Interop.Excel;
    namespace ConsoleApplication2
    {
        class Program
        {
            static void Main(string[] args)
            {
                var bankAccounts = new List<Account> {
                    new Account { ID = 345678, Balance = 541.27},
                    new Account {ID = 1230221,Balance = -1237.44},
                    new Account {ID = 346777,Balance = 3532574},
                    new Account {ID = 235788,Balance = 1500.033333}
    };
                DisplayInExcel(bankAccounts);
            }
            static void DisplayInExcel(IEnumerable<Account> accounts)
            {
                var excelApp = new Excel.Application { Visible = true };
                excelApp.Workbooks.Add();
                Excel._Worksheet workSheet = (Excel.Worksheet)excelApp.ActiveSheet;
                workSheet.Cells[1, "A"] = "ID Number";
                workSheet.Cells[1, "B"] = "Current Balance";
                var row = 1;
                foreach (var acct in accounts)
                {
                    row++;
                    workSheet.Cells[row, "A"] = acct.ID;
                    workSheet.Cells[row, "B"] = acct.Balance;
    
                }
                workSheet.Range["B2", "B" + row].NumberFormat = "#,###.00 €";
                workSheet.Columns[1].AutoFit();
                workSheet.Columns[2].AutoFit();
            }
        }
        public class Account
        {
            public int ID { get; set; }
            public double Balance { get; set; }
        }
    }
    

    The Output

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed a small administration page for game servers which you can add/remove/edit
I developed small CakePHP application, and now I want to add one more table
I have developed a PyroCMS custom module, but now I want to add WYSIWYG
Can anybody tell me how to add signature in jar file. I have developed
Ï developed a little SQLite database to add a list of goods, when I
I've developed a nice rich application interface using Backbone.js where users can add objects
I have developed a desktop application. Now in that app I want to add
I develop Excel 2007 add-in and use Microsoft.Office.Interop.Excel.Application.ActiveSheet. How can I save it in
I have developed an excel add-in using Visual studio 2010 with target framework as
I have a solution in VS2010 that was developed as an Excel 2007 add-in.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.