Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Setting Excel cell format

I need to export data to an excel file programmatically. Date includes time
in form of min:sec and full date with time. IRange::PutValue2 accepts variant
and if I pass COleVaraint created from COleDateTime I have excel show value
as a double "39726.47661". I need to manually right click and select "Format
Cells..." menu, then select Date or time Category and then the value is shown
as I want. How can I do all this programmatically so that value is shown as
date and time initially?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 364
Default Setting Excel cell format

This is the way Excel internally stores dates. You need to
1. Set the format in your import program if you can or
2. Have a macro to do that or
3. Convert the dates before importing to the format you want but then they
will be treated as text and not dates in Excel.

"Sasha" wrote:

I need to export data to an excel file programmatically. Date includes time
in form of min:sec and full date with time. IRange::PutValue2 accepts variant
and if I pass COleVaraint created from COleDateTime I have excel show value
as a double "39726.47661". I need to manually right click and select "Format
Cells..." menu, then select Date or time Category and then the value is shown
as I want. How can I do all this programmatically so that value is shown as
date and time initially?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting all users to save Excel 2007 files in 2003 format Owen K Excel Discussion (Misc queries) 0 August 16th 08 01:31 AM
Setting an Icon Set conditional format for a single cell??? MikeV Excel Discussion (Misc queries) 4 February 14th 08 12:20 AM
MY 2003 Excel does not show cell colors. Solution? Setting? WetRiverOak Excel Discussion (Misc queries) 1 August 2nd 06 04:21 AM
How to return the default setting of numbering format in Excel? saturn Excel Discussion (Misc queries) 1 July 7th 06 07:40 AM
Setting Cell Number Format With A Worksheet Function [email protected] Excel Worksheet Functions 1 December 16th 05 07:37 PM


All times are GMT +1. The time now is 10:56 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"