|
-
April 17th, 2008, 11:39 AM
#1
String from C++ code pasted into Excel has formatting problem
TCHAR text[256];
_stprintf(text, _T("2-4"));
Using code like this I copy 'text' to the clipboard and then paste it into Excel. But Excel interprets "2-4" as February 4th and puts "4-Feb" into the cell.
Is there some way I can format a string so that Excel does not try to do a conversion?
When entering the string directly into Excel typing an apostrophe (') first will work, but from C++ code the apostrophe stays when pasted into the cell.
I have also tried putting quotes around the string - _stprintf(_T("\"2-4\"")) - but that doesn't work either.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|