<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[QAxObject format Excel cell]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I'm using Qt 5.11 and C++.<br />
The question is hot format Excel cells to be as a text.<br />
E.g., if I set the value to 1.1, then it gets converted to date.<br />
The output of this code snippet is:<br />
Set value to "1.1"<br />
"01.jaan"</p>
<pre><code>QAxObject* cell = sheet-&gt;querySubObject("Cells(int,int)", row, col);

if (cell != nullptr)
{
	QString testValue = QString("%1.%2").arg(row).arg(col);
	qDebug() &lt;&lt; "Set value to" &lt;&lt; testValue;

	cell-&gt;setProperty("Value", testValue);
	QString newValue = cell-&gt;dynamicCall("Text()").toString();

	qDebug() &lt;&lt; newValue;
}
</code></pre>
]]></description><link>https://forum.qt.io/topic/126391/qaxobject-format-excel-cell</link><generator>RSS for Node</generator><lastBuildDate>Sat, 16 May 2026 03:47:41 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/126391.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 06 May 2021 11:54:56 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QAxObject format Excel cell on Fri, 07 May 2021 13:49:27 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">The leading ' is a nice trick, and I can use it as a workaround.<br />
Thanks!</p>
]]></description><link>https://forum.qt.io/post/658509</link><guid isPermaLink="true">https://forum.qt.io/post/658509</guid><dc:creator><![CDATA[Indrek M]]></dc:creator><pubDate>Fri, 07 May 2021 13:49:27 GMT</pubDate></item><item><title><![CDATA[Reply to QAxObject format Excel cell on Fri, 07 May 2021 12:31:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vronin">@<bdi>VRonin</bdi></a><br />
LOL, wow, OK, thanks! :)</p>
]]></description><link>https://forum.qt.io/post/658494</link><guid isPermaLink="true">https://forum.qt.io/post/658494</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Fri, 07 May 2021 12:31:00 GMT</pubDate></item><item><title><![CDATA[Reply to QAxObject format Excel cell on Fri, 07 May 2021 12:02:28 GMT]]></title><description><![CDATA[<p dir="auto">From</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/indrek-m">@<bdi>Indrek-M</bdi></a> said in <a href="/post/658270">QAxObject format Excel cell</a>:</p>
<blockquote>
<p dir="auto">"01.jaan"</p>
</blockquote>
<p dir="auto">Google tells me this is Estonian and <code>QLocale(QLocale::Estonian,QLocale::Estonia).decimalPoint()</code> returns <code>,</code> that's why <code>.</code> is not interpreted as a decimal point</p>
]]></description><link>https://forum.qt.io/post/658489</link><guid isPermaLink="true">https://forum.qt.io/post/658489</guid><dc:creator><![CDATA[VRonin]]></dc:creator><pubDate>Fri, 07 May 2021 12:02:28 GMT</pubDate></item><item><title><![CDATA[Reply to QAxObject format Excel cell on Fri, 07 May 2021 11:49:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vronin">@<bdi>VRonin</bdi></a><br />
Hi.  I assumed this (the leading <code>'</code>) would be the answer.</p>
<p dir="auto">But I am also intrigued.  I don't want to go look up the Excel docs, which is where this comes from.  Do you know <em>why</em> Excel treats an unquoted <code>1.1</code> as a date rather than a floating point number?  My thought would be that although one does sometimes type dates into cells, it is considerably more likely to type a floating point number (e.g. a price), so seems strange to me that the default interpretation is selected as date rather than number?</p>
]]></description><link>https://forum.qt.io/post/658484</link><guid isPermaLink="true">https://forum.qt.io/post/658484</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Fri, 07 May 2021 11:49:07 GMT</pubDate></item><item><title><![CDATA[Reply to QAxObject format Excel cell on Fri, 07 May 2021 09:10:39 GMT]]></title><description><![CDATA[<p dir="auto">Try <code>QString testValue = QString("'%1.%2").arg(row).arg(col);</code></p>
]]></description><link>https://forum.qt.io/post/658424</link><guid isPermaLink="true">https://forum.qt.io/post/658424</guid><dc:creator><![CDATA[VRonin]]></dc:creator><pubDate>Fri, 07 May 2021 09:10:39 GMT</pubDate></item></channel></rss>