<?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[Strings aus Excel Zellen lesen]]></title><description><![CDATA[<p>Hi,</p>
<p>wie schon mal geschrieben verwende ich die TMLExcel Wrapper Klasse in abgewandelter Form.<br />
Das Konzept funktioniert auch sehr gut.<br />
Wenn ich Werte aus einer Excel Zelle lesen will und diese dann von AnsiString nach Float konvertiere kann ich diese Speichern.</p>
<p>Nun zum Problem.<br />
Ich möchte einen String aus einer Zelle in einer AnsiString Variablen speichern. Dabei kommt immer wieder die Fehlermeldung.<br />
&quot;Variante des Typs (OleStr) konnte nicht in Typ (Double) konvertiert werden&quot;.<br />
Ich hab schon ein wenig rumprobiert ... leider ohne Erfolg.</p>
<p>Danke für eure Antworten</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/206022/strings-aus-excel-zellen-lesen</link><generator>RSS for Node</generator><lastBuildDate>Wed, 19 Aug 2026 23:00:51 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/206022.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 20 Feb 2008 14:01:03 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Strings aus Excel Zellen lesen on Wed, 20 Feb 2008 14:01:03 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>wie schon mal geschrieben verwende ich die TMLExcel Wrapper Klasse in abgewandelter Form.<br />
Das Konzept funktioniert auch sehr gut.<br />
Wenn ich Werte aus einer Excel Zelle lesen will und diese dann von AnsiString nach Float konvertiere kann ich diese Speichern.</p>
<p>Nun zum Problem.<br />
Ich möchte einen String aus einer Zelle in einer AnsiString Variablen speichern. Dabei kommt immer wieder die Fehlermeldung.<br />
&quot;Variante des Typs (OleStr) konnte nicht in Typ (Double) konvertiert werden&quot;.<br />
Ich hab schon ein wenig rumprobiert ... leider ohne Erfolg.</p>
<p>Danke für eure Antworten</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1459468</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1459468</guid><dc:creator><![CDATA[Grim_Reaper]]></dc:creator><pubDate>Wed, 20 Feb 2008 14:01:03 GMT</pubDate></item><item><title><![CDATA[Reply to Strings aus Excel Zellen lesen on Wed, 20 Feb 2008 14:49:27 GMT]]></title><description><![CDATA[<p>wie sieht der Quellcode denn aus?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1459511</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1459511</guid><dc:creator><![CDATA[Linnea]]></dc:creator><pubDate>Wed, 20 Feb 2008 14:49:27 GMT</pubDate></item><item><title><![CDATA[Reply to Strings aus Excel Zellen lesen on Wed, 20 Feb 2008 14:49:43 GMT]]></title><description><![CDATA[<p>Grim_Reaper schrieb:</p>
<blockquote>
<p>Dabei kommt immer wieder die Fehlermeldung [...]</p>
</blockquote>
<p>Wobei genau? Die Kristallkugel hat sich als Fälschung herausgestellt ...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1459514</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1459514</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Wed, 20 Feb 2008 14:49:43 GMT</pubDate></item><item><title><![CDATA[Reply to Strings aus Excel Zellen lesen on Thu, 21 Feb 2008 06:09:06 GMT]]></title><description><![CDATA[<p>Hat sich erledigt.</p>
<p>Ich hatte einen exception handle in die Funktion GetCellString eingebaut, der<br />
denn Fall abfangen soll, wenn die Zelle leer ist.<br />
Leider hatte ich vergessen, das NULL nicht vom Datentyp String ist.</p>
<p>mit</p>
<pre><code class="language-cpp">static_call&lt;AnsiString&gt;(NULL)
</code></pre>
<p>hat sich das Problem erledigt.</p>
<p>Danke!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1459911</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1459911</guid><dc:creator><![CDATA[Grim_Reaper]]></dc:creator><pubDate>Thu, 21 Feb 2008 06:09:06 GMT</pubDate></item><item><title><![CDATA[Reply to Strings aus Excel Zellen lesen on Thu, 21 Feb 2008 07:04:21 GMT]]></title><description><![CDATA[<p>OK selbst dann sind noch einige Fehler aufgetreten.<br />
Das Problem ist einfach folgendes:</p>
<p>Es geht um eigentlich um typische Stringkonvertierung und leere Zellen.<br />
Problem ist, dass ein Datum in einer Zelle sowohl (und auch oft) eine Zahl sein kann, als auch ein String.</p>
<p>Um ein und dieselbe Funktion zu verwenden, um Daten aus Zellen zu lesen<br />
müssen also verschiedene &quot;Ausnahmen&quot; abgefangen werden.<br />
Eine Besonderheit stellen hier empry Cells (also leere Zellen) dar.<br />
Mit der TMLExcel Wrapper Klasse (ist wirklich ein geiles Teil, props an die<br />
oder den Entwickler) wird jedes Datum als String eingelesen.<br />
Bei der Konvertierung von Str zu Float z.B. kann es im Falle einer leeren<br />
Zelle so zu Problemen kommen.</p>
<p>Ich hab das mal unelegant so umgangen:</p>
<pre><code class="language-cpp">String __fastcall TMLWorksheet::GetCellString(int Col, int Row)
{
        AnsiString temp;

        if(var_Sheet.OlePropertyGet(&quot;Cells&quot;,Col+1,Row+1).OlePropertyGet(&quot;Value&quot;)==(static_cast&lt;AnsiString&gt;(NULL)))
                temp = &quot;0&quot;;
        else
                temp = var_Sheet.OlePropertyGet(&quot;Cells&quot;,Col+1,Row+1).OlePropertyGet(&quot;Value&quot;);
        if ((temp==NULL)||(temp==&quot;&quot;))
                temp = &quot;0&quot;;
        return temp;

}
</code></pre>
<p>Cheers</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1459918</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1459918</guid><dc:creator><![CDATA[Grim_Reaper]]></dc:creator><pubDate>Thu, 21 Feb 2008 07:04:21 GMT</pubDate></item><item><title><![CDATA[Reply to Strings aus Excel Zellen lesen on Thu, 21 Feb 2008 08:31:43 GMT]]></title><description><![CDATA[<p>es gibst auch Funktionen zum Stringumwandeln, die Fehler automatisch abfangen und im Fehlerfall einen Default-Wert zurückgeben: <em>StrToFloatDef, StrToIntDef, StrToDateTimeDef</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1459948</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1459948</guid><dc:creator><![CDATA[Linnea]]></dc:creator><pubDate>Thu, 21 Feb 2008 08:31:43 GMT</pubDate></item><item><title><![CDATA[Reply to Strings aus Excel Zellen lesen on Thu, 21 Feb 2008 09:58:22 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">AnsiString __fastcall TMLWorksheet::GetCellString(int Col, int Row)
{
        Variant vtemp = var_Sheet.OlePropertyGet(&quot;Cells&quot;,Col+1,Row+1).OlePropertyGet(&quot;Value&quot;);
        if( !(vtemp.IsNull() || vtemp.IsEmpty()))
          return &quot;0&quot;;
        return AnsiString(vtemp); // Cast eigentlich nicht nötig
}
</code></pre>
<p>etwas kürzer aber ungetestet. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1460021</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1460021</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Thu, 21 Feb 2008 09:58:22 GMT</pubDate></item><item><title><![CDATA[Reply to Strings aus Excel Zellen lesen on Thu, 21 Feb 2008 10:36:47 GMT]]></title><description><![CDATA[<p>Danke schön!!!</p>
<p>Ist für mich etwas problematisch.<br />
Ich komme eigentlich von C und hab dort das meiste für<br />
Microcontroller bzw. DSP-Anwendungen geschrieben.</p>
<p>Ist mein erstes Projekt mit C++ und in OOP bin ich auch noch nicht ganz drin.<br />
Von daher entgehen mir öfter mal ein paar Funktionen bzw. Methoden,<br />
da ich diese bzw. die Klassen einfach noch nicht kenne.</p>
<p>Viele Grüße</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1460056</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1460056</guid><dc:creator><![CDATA[Grim_Reaper]]></dc:creator><pubDate>Thu, 21 Feb 2008 10:36:47 GMT</pubDate></item><item><title><![CDATA[Reply to Strings aus Excel Zellen lesen on Thu, 21 Feb 2008 10:38:42 GMT]]></title><description><![CDATA[<p>Dann ist es am Besten immer mal in der Hilfe nachzuschauen und die dortigen Links (Typen, Methoden, Eigenschaften) zu verfolgen. So kann man viel lernen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1460058</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1460058</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Thu, 21 Feb 2008 10:38:42 GMT</pubDate></item></channel></rss>