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

  • Home
  • SEARCH
  • 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 645297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:29:11+00:00 2026-05-13T21:29:11+00:00

I am creating an Excel document using owc11. I am providing the dates in

  • 0

I am creating an Excel document using owc11. I am providing the dates in dd/mm/yyyy format. I am doing something like this in the code:

for (..looping through results..)
{
    Range c = EmailStats.putCellValue(sheet, row, 1, val);
    c.set_NumberFormat("dd/mm/yyyy");
}

private static Range putCellValue(Worksheet sheet, int row, int col, String val) 
{
    Range cell = (Range) sheet.Cells[row, col];
    cell.set_Value(XlRangeValueType.xlRangeValueDefault, val);
    return cell;
}

Now when for the val argument I set the date format as “dd/mm/yyyy” or not set it at all, the behaviour I get is mm/dd/yyyy from the 1st of a month up and till the 12th and then it swaps back to dd/mm/yyyy. So owc11 thinks that it knows better and swaps the days and month around (like in the US format) and when it is over the 12th date it sticks to the UK format.

Val is declared as String because it may not always be a date. It may be a date, a day, a user name, group name etc depending on how we group/sort our data. Also it may be a selection of days.

After experimenting a while I figured out that the only way to solve this is to use the universal date format of yyyy/mm/dd. However that may create other integration problems. So I was hoping that there may be a way to enforce the dd/mm/yyyy format, so please any suggestions are welcome.

  • 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-05-13T21:29:12+00:00Added an answer on May 13, 2026 at 9:29 pm

    Try to set val as not string. Try assign val as DateTime.

    cell.set_Value(XlRangeValueType.xlRangeValueDefault, val);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 317k
  • Answers 317k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You should work with something like so: public boolean onTouchEvent(MotionEvent… May 13, 2026 at 11:49 pm
  • Editorial Team
    Editorial Team added an answer @media screen and (-webkit-min-device-pixel-ratio:0) { /*Chrome CSS here*/ #cartUpdate {… May 13, 2026 at 11:49 pm
  • Editorial Team
    Editorial Team added an answer You can use Dir.glob to find the files you need.… May 13, 2026 at 11:49 pm

Related Questions

I am creating a C# windows application to create an Excel 2003 sheet. There
What is the state generating Excel documents from a PHP application on a Linux
I am stuck! this seems really daft but I can not see where I
I am creating an Excel Worksheet from C# using Microsoft.Office.Interop.Excel, and I have not
I am creating a copy of an Excel file using VBA. In the file,

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.