In my application, I export text and other data to Excel. Occasionally, some text strings start with a "+". Excel treates these as malformed formulae. How do I make Excel treat this data a simply text?
The batch file runs tha application, which generates a report as a CSV. Then the batch file checks to see if the CSV file has been created, and if so, opens it with the START command.
My son called me. I asked him the question. He said put an "=" before the open quote. That does exactly what I want, causes Excel to treat the string within the quotes as text, nothing else.
As I said, I can put any codes in the .CSV. I tried using quotes, it didn't make any difference, except when the text itself contained commas. Excel extracts the string from the quotes and then interprets it. Numeric strings are treated as numbers, and strings that start with a "+" are treated as mal-formed formulae. I can prevent the former by including a space before the close quote, but I couldn't come up with any way to stop the latter. The "=" is a general solution.
Being able to put any code in the CSV is implicit in my original statment that my application generates the CSV.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.