Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default 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
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
Statement writing problem Clay Excel Worksheet Functions 4 March 15th 07 04:55 PM
Date format/Writing to a file problem clayton Excel Discussion (Misc queries) 0 August 8th 06 01:31 AM
Problem writing formula Millicent Excel Worksheet Functions 1 March 29th 06 02:26 AM
Formula writing problem Bob Excel Worksheet Functions 2 November 4th 05 10:33 PM
Problem writing formulas - please, please help! Oliver Kharraz Excel Programming 1 December 1st 03 12:03 PM


All times are GMT +1. The time now is 05:23 PM.

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"