Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Setting all users to save Excel 2007 files in 2003 format | Excel Discussion (Misc queries) | |||
Setting an Icon Set conditional format for a single cell??? | Excel Discussion (Misc queries) | |||
MY 2003 Excel does not show cell colors. Solution? Setting? | Excel Discussion (Misc queries) | |||
How to return the default setting of numbering format in Excel? | Excel Discussion (Misc queries) | |||
Setting Cell Number Format With A Worksheet Function | Excel Worksheet Functions |