Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem with writing CString Date to cell
I am using automation to write data from Visual C++ 6 to an excel
spreadsheet. I am having problem writing the string "12/10/2004" to a cell as it swaps the 10 and 12 around!!!. I assume this has something to do with american dates. I use the code below to write the string to the cell i want :- m_objRange = m_objSheet2.GetRange(COleVariant("A3"),COleVariant ("A3")); m_objRange.SetValue2(COleVariant("12/10/2004")); It write the string to the correct cell but the day and month have been swapped. Can anyone tell me how i can stop this happening? Thanks In Advance Macca |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem with writing CString Date to cell
Hi
why not format the cell to a different date format? -- Regards Frank Kabel Frankfurt, Germany Macca wrote: I am using automation to write data from Visual C++ 6 to an excel spreadsheet. I am having problem writing the string "12/10/2004" to a cell as it swaps the 10 and 12 around!!!. I assume this has something to do with american dates. I use the code below to write the string to the cell i want :- m_objRange = m_objSheet2.GetRange(COleVariant("A3"),COleVariant ("A3")); m_objRange.SetValue2(COleVariant("12/10/2004")); It write the string to the correct cell but the day and month have been swapped. Can anyone tell me how i can stop this happening? Thanks In Advance Macca |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem with writing CString Date to cell
Thanks for the tip Frank. How do I do this through Automation?
Thanks, Macca "Frank Kabel" wrote: Hi why not format the cell to a different date format? -- Regards Frank Kabel Frankfurt, Germany Macca wrote: I am using automation to write data from Visual C++ 6 to an excel spreadsheet. I am having problem writing the string "12/10/2004" to a cell as it swaps the 10 and 12 around!!!. I assume this has something to do with american dates. I use the code below to write the string to the cell i want :- m_objRange = m_objSheet2.GetRange(COleVariant("A3"),COleVariant ("A3")); m_objRange.SetValue2(COleVariant("12/10/2004")); It write the string to the correct cell but the day and month have been swapped. Can anyone tell me how i can stop this happening? Thanks In Advance Macca |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Statement writing problem | Excel Worksheet Functions | |||
Date format/Writing to a file problem | Excel Discussion (Misc queries) | |||
Problem writing formula | Excel Worksheet Functions | |||
Formula writing problem | Excel Worksheet Functions | |||
Problem writing formulas - please, please help! | Excel Programming |