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 6953827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:31:42+00:00 2026-05-27T14:31:42+00:00

My C# Excel addon is transforming a time series into another time series. Time

  • 0

My C# Excel addon is transforming a time series into another time series.

Time series is defined as a two column range with the first column being date and second column being a floating point number.

Though my C# code is returning back DateTime for date, the Excel converts it into Excel date represented by integer and the displayed value is the integer, e.g. 39000, not a date format, e.g. 14/12/2012.

Thus, the user has to press CTRL + # to turn it into dates.

Is there a way somehow return the output of a C# excel addon already Excel formatted as Date?

  • 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-27T14:31:42+00:00Added an answer on May 27, 2026 at 2:31 pm

    a) Format the cells from the code which returns the values. E.g. if you have a handle to the range object, you can do something like range.NumberFormat="yyyy-mm-dd".

    b) Pre-format the cells to a date format before running the code which imports the data. This would work if the same sheet is used each time, rather than a blank or arbitrary sheet.

    c) This is an ugly hack, but try returning your date values as strings, formatted as “mm/dd/yyyy”. This should force Excel to interpret the values as dates. AFAIK the machine locale settings will not affect the translation in this case.

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

Sidebar

Related Questions

I have an XLL Excel addin and now another team wants to use the
Excel AddIn, C#, UDF, MyUDF calls a web service to retrieve certain date. Sometimes
Whenever I try to add a new ribbon into my Excel 2010 addin project,
This is a very common problem when Excel Worksheet or Chart is embedded into
I'm writing an Excel Addin using COM Interop from .net. I have a command
In a VSTO Excel addin the code: Dim XMLDoc As XElement = XElement.Load(XMLFile1.xml) generates
I've created an addin for Excel containing a number of different functions. Now, I
I have successfully used the Excel and Word addin templates in Visual studio 2008
Excel has a Conditional Formatting... option under the Format menu that allows you to
Excel macros do not seem to allow the use of undo after running them.

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.