<?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[Formatierung in Excel]]></title><description><![CDATA[<p>Hallo erstmal,</p>
<p>hier im Forum steht schon eine Menge zum Thema &quot;Excel&quot;, für o. a. Problem habe ich aber leider (auch in der BCB-Hilfe) nichts gefunden.<br />
Ich möchte die Spaltenbreite an die eingegebenen Werte automatisch anpassen oder aber zumindest ändern können ebenso wie die Schriftgröße bzw. den Schrifttyp.</p>
<p>Mein Code sieht z. Z. so aus:</p>
<pre><code>void __fastcall TFZK_Drehen::BtnExcelClick(TObject *Sender)
{
Variant vMSExcel;

vMSExcel = Variant::CreateObject(&quot;Excel.Application&quot;);
vMSExcel.OlePropertySet(&quot;Visible&quot;, true);

Variant vXLWorkbook, vXLWorkbooks;

vXLWorkbooks = vMSExcel.OlePropertyGet(&quot;Workbooks&quot;);
vXLWorkbook = vXLWorkbooks.OleFunction(&quot;Add&quot;);

Variant vWorksheet, vSheetName;

vSheetName = &quot;Tabelle1&quot;;
vWorksheet = vXLWorkbook.OlePropertyGet(&quot;Worksheets&quot;,vSheetName);

Variant vValue, vRange, vCell;
vRange = &quot;A2&quot;;
vCell = vWorksheet.OlePropertyGet(&quot;Range&quot;, vRange);
vValue = Fc;
vCell.OlePropertySet(&quot;Value&quot;, vValue);

...
</code></pre>
<p>Wenn mir also jemad sagen könnte, wie ich die Spaltenbreite und den Textstil ändern kann, wär's klasse.</p>
<p>Vielen Dank schon mal für die Anworten.<br />
Gruß Dutchman</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/115447/formatierung-in-excel</link><generator>RSS for Node</generator><lastBuildDate>Thu, 23 Jul 2026 20:53:45 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/115447.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 14 Jul 2005 11:22:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Formatierung in Excel on Thu, 14 Jul 2005 11:22:24 GMT]]></title><description><![CDATA[<p>Hallo erstmal,</p>
<p>hier im Forum steht schon eine Menge zum Thema &quot;Excel&quot;, für o. a. Problem habe ich aber leider (auch in der BCB-Hilfe) nichts gefunden.<br />
Ich möchte die Spaltenbreite an die eingegebenen Werte automatisch anpassen oder aber zumindest ändern können ebenso wie die Schriftgröße bzw. den Schrifttyp.</p>
<p>Mein Code sieht z. Z. so aus:</p>
<pre><code>void __fastcall TFZK_Drehen::BtnExcelClick(TObject *Sender)
{
Variant vMSExcel;

vMSExcel = Variant::CreateObject(&quot;Excel.Application&quot;);
vMSExcel.OlePropertySet(&quot;Visible&quot;, true);

Variant vXLWorkbook, vXLWorkbooks;

vXLWorkbooks = vMSExcel.OlePropertyGet(&quot;Workbooks&quot;);
vXLWorkbook = vXLWorkbooks.OleFunction(&quot;Add&quot;);

Variant vWorksheet, vSheetName;

vSheetName = &quot;Tabelle1&quot;;
vWorksheet = vXLWorkbook.OlePropertyGet(&quot;Worksheets&quot;,vSheetName);

Variant vValue, vRange, vCell;
vRange = &quot;A2&quot;;
vCell = vWorksheet.OlePropertyGet(&quot;Range&quot;, vRange);
vValue = Fc;
vCell.OlePropertySet(&quot;Value&quot;, vValue);

...
</code></pre>
<p>Wenn mir also jemad sagen könnte, wie ich die Spaltenbreite und den Textstil ändern kann, wär's klasse.</p>
<p>Vielen Dank schon mal für die Anworten.<br />
Gruß Dutchman</p>
]]></description><link>https://www.c-plusplus.net/forum/post/831228</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/831228</guid><dc:creator><![CDATA[Dutchman]]></dc:creator><pubDate>Thu, 14 Jul 2005 11:22:24 GMT</pubDate></item><item><title><![CDATA[Reply to Formatierung in Excel on Thu, 14 Jul 2005 11:39:24 GMT]]></title><description><![CDATA[<p>Den Code würd ich sofort löschen. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61b.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_tongue"
      title=":P"
      alt="😛"
    /><br />
Ich hoffe du bist dir bewusst das dies nur mit MS Excel zusammenarbeitet und nicht mit Excel in OpenOffice. Besser wäre eine Native Steuerung wie sie FLEXCEL von TMSSoftware zusätzlich machen kann.</p>
<p>Quelle <a href="http://www.tmssoftware.com/flexcel.htm" rel="nofollow">http://www.tmssoftware.com/flexcel.htm</a></p>
<p>Die Formatierung etc ist damit kinderleicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/831248</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/831248</guid><dc:creator><![CDATA[michii]]></dc:creator><pubDate>Thu, 14 Jul 2005 11:39:24 GMT</pubDate></item><item><title><![CDATA[Reply to Formatierung in Excel on Thu, 14 Jul 2005 11:59:11 GMT]]></title><description><![CDATA[<p>Spaltenbreite:</p>
<pre><code class="language-cpp">vWorksheet.OlePropertyGet(&quot;Columns&quot;,&quot;B&quot;).OlePropertySet(&quot;ColumnWidth&quot;,500);
</code></pre>
<p>Schriftgroesse:</p>
<pre><code class="language-cpp">vCell.OlePropertyGet(&quot;Font&quot;).OlePropertySet(&quot;Size&quot;,15);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/831261</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/831261</guid><dc:creator><![CDATA[YLIREBUS]]></dc:creator><pubDate>Thu, 14 Jul 2005 11:59:11 GMT</pubDate></item><item><title><![CDATA[Reply to Formatierung in Excel on Thu, 14 Jul 2005 12:06:27 GMT]]></title><description><![CDATA[<p>u.a. Fontname</p>
<pre><code class="language-cpp">Variant   vFont = Selection.OlePropertyGet(&quot;Font&quot;); 
      vFont.OlePropertySet(&quot;Name&quot;, WideString(&quot;Arial&quot;)); 
      vFont.OlePropertySet(&quot;Size&quot;, 14); 
      vFont.OlePropertySet(&quot;Bold&quot;, true);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/831274</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/831274</guid><dc:creator><![CDATA[YLIREBUS]]></dc:creator><pubDate>Thu, 14 Jul 2005 12:06:27 GMT</pubDate></item><item><title><![CDATA[Reply to Formatierung in Excel on Thu, 14 Jul 2005 12:09:25 GMT]]></title><description><![CDATA[<p>Hy,</p>
<p>zum einen: das ist mein Erstlingswerk bei der Verknüpfung von BCB und Excel, ich bin froh, dass das Ding überhaupt läuft!<br />
Wenn du (oder jemand anderes) mir einen schöneren Code geben würde, gerne!</p>
<p>Das Flexcel hört sich ja gut an, habs mir installiert und werde es mir nun mal anschauen.</p>
<p>Danke!<br />
Dutchman</p>
]]></description><link>https://www.c-plusplus.net/forum/post/831279</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/831279</guid><dc:creator><![CDATA[Dutchman]]></dc:creator><pubDate>Thu, 14 Jul 2005 12:09:25 GMT</pubDate></item><item><title><![CDATA[Reply to Formatierung in Excel on Thu, 14 Jul 2005 20:21:31 GMT]]></title><description><![CDATA[<p>Um den Quellcode ging es mir doch garnicht -.- sondern nur das er (inhaltlich!) rein nur MS Excel kompatibel ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/831369</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/831369</guid><dc:creator><![CDATA[michii]]></dc:creator><pubDate>Thu, 14 Jul 2005 20:21:31 GMT</pubDate></item><item><title><![CDATA[Reply to Formatierung in Excel on Fri, 15 Jul 2005 08:04:30 GMT]]></title><description><![CDATA[<p>So weit ich das verstanden habe, ist die von dir erwähnte Komponente auch an MS Excel gebunden...</p>
<p>StarOffice oder OpenOffice lassen sich damit auch nicht automatisieren und deren Dateiformate werden auch nicht beherrscht. Wo ist also der Fortschritt (abgesehen davon, das ich Excel nicht installiert haben muss)?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/831573</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/831573</guid><dc:creator><![CDATA[-**xXx**-]]></dc:creator><pubDate>Fri, 15 Jul 2005 08:04:30 GMT</pubDate></item><item><title><![CDATA[Reply to Formatierung in Excel on Fri, 15 Jul 2005 08:11:30 GMT]]></title><description><![CDATA[<p>Das Programm muss hinterher auch nur mit Excel arbeiten können, aber ist ja auch egal.</p>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/630">@YLIREBUS</a>: Der Code für die Schrifgröße und Spaltenbreite funktioniert gut, bei den Schrifteistellungen gibt er die Fehlermeldung:</p>
<p>&quot;Undefiniertes Symbal 'Selection' &quot;</p>
<p>Wenn ich ein Makro in Excel aufzeichne bekomme ich aber ebenfalls 'Selection' als Begriff....</p>
]]></description><link>https://www.c-plusplus.net/forum/post/831585</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/831585</guid><dc:creator><![CDATA[Dutchman]]></dc:creator><pubDate>Fri, 15 Jul 2005 08:11:30 GMT</pubDate></item><item><title><![CDATA[Reply to Formatierung in Excel on Fri, 15 Jul 2005 08:50:39 GMT]]></title><description><![CDATA[<p>@-=]xXx[=-<br />
Ich habe die Komponente gekauft und ich habe OpenOffice und oh wunder es geht.<br />
Du kannst dort entweder die möglichkeit OLE also MS Excel anzusprechen oder eine Native das sind 2 verschiedene Komponeten in diesem Pack!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/831622</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/831622</guid><dc:creator><![CDATA[michii]]></dc:creator><pubDate>Fri, 15 Jul 2005 08:50:39 GMT</pubDate></item><item><title><![CDATA[Reply to Formatierung in Excel on Fri, 15 Jul 2005 08:56:55 GMT]]></title><description><![CDATA[<p>Dutchman schrieb:</p>
<blockquote>
<p>Das Programm muss hinterher auch nur mit Excel arbeiten können, aber ist ja auch egal.</p>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/630">@YLIREBUS</a>: Der Code für die Schrifgröße und Spaltenbreite funktioniert gut, bei den Schrifteistellungen gibt er die Fehlermeldung:</p>
<p>&quot;Undefiniertes Symbal 'Selection' &quot;</p>
<p>Wenn ich ein Makro in Excel aufzeichne bekomme ich aber ebenfalls 'Selection' als Begriff....</p>
</blockquote>
<p>Selection ist wohl die aktuelle Zelle...<br />
Die musste Dir erst mal holen..</p>
<p>Edit 1:<br />
Kenn mich jetzt nich so mit dem Excel-Zugriff aus, aber da wirste wohl auch erst einen Variant machen müssen den dann mit &quot;Selection&quot; aus Excel füllen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/831629</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/831629</guid><dc:creator><![CDATA[Errraddicator]]></dc:creator><pubDate>Fri, 15 Jul 2005 08:56:55 GMT</pubDate></item><item><title><![CDATA[Reply to Formatierung in Excel on Fri, 15 Jul 2005 09:33:39 GMT]]></title><description><![CDATA[<p>michii schrieb:</p>
<blockquote>
<p>@-=]xXx[=-<br />
Ich habe die Komponente gekauft und ich habe OpenOffice und oh wunder es geht.<br />
Du kannst dort entweder die möglichkeit OLE also MS Excel anzusprechen oder eine Native das sind 2 verschiedene Komponeten in diesem Pack!</p>
</blockquote>
<p>Was verstehst du unter &quot;es geht&quot;? OLE-Steuerung, oder .xls-Datein erstellen?<br />
ersteres hat mit letzterem gar nix zu tun und mit .xls-Datein bist du auch nicht Unabhängig, sondern auf Importfilter anderer Office-Packete angewiesen.<br />
Da Programmiere ich doch lieber eine OLE-Steuerung für Excel, für OO und für StarOffice, damit der Benutzer wählen kann...</p>
<p>@ Dutchman<br />
Probier mal folgendes:</p>
<pre><code>int Column=1;
int Width=40;
vAktivSheet.OlePropertyGet(&quot;Columns&quot;,Column).OlePropertySet(&quot;ColumnWidth&quot;,Width);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/831668</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/831668</guid><dc:creator><![CDATA[-**xXx**-]]></dc:creator><pubDate>Fri, 15 Jul 2005 09:33:39 GMT</pubDate></item><item><title><![CDATA[Reply to Formatierung in Excel on Fri, 15 Jul 2005 16:53:03 GMT]]></title><description><![CDATA[<p>Hallo -=]xXx[=-,</p>
<p>der von YLIREBUS gepostete Code für die Spaltenbreite war in Ordnung, bei der Zellenformatierung gabs Probleme.<br />
Selection war gar nicht nötig. Hat mit</p>
<pre><code>vCell.OlePropertyGet(&quot;Font&quot;).OlePropertySet(&quot;Size&quot;,15);
vCell.OlePropertyGet(&quot;Font&quot;).OlePropertySet(&quot;Bold&quot;,true);
</code></pre>
<p>funktioniert.</p>
<p>Noch nicht gefunden habe ich jetzt den Code für &quot;Text mittig&quot; bzw. &quot;Text links/rechts bündig&quot;..</p>
]]></description><link>https://www.c-plusplus.net/forum/post/831904</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/831904</guid><dc:creator><![CDATA[Dutchman]]></dc:creator><pubDate>Fri, 15 Jul 2005 16:53:03 GMT</pubDate></item><item><title><![CDATA[Reply to Formatierung in Excel on Fri, 15 Jul 2005 19:25:15 GMT]]></title><description><![CDATA[<p>Oh man, das Wetter scheint mir auf das Sehvermögen zu schlagen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>Für Textausrichtung probier mal folgendes (nicht getestet!):</p>
<pre><code class="language-cpp">xlLabelPositionCenter = -4108;
  xlLabelPositionAbove = 0;
  xlLabelPositionBelow = 1;
  xlLabelPositionLeft = -4131;
  xlLabelPositionRight = -4152;
  xlLabelPositionOutsideEnd = 2;
  xlLabelPositionInsideEnd = 3;
  xlLabelPositionInsideBase = 4;
  xlLabelPositionBestFit = 5;
  xlLabelPositionMixed = 6;
  xlLabelPositionCustom = 7;

vCell.OlePropertyGet(&quot;Font&quot;).OlePropertySet(&quot;Position&quot;,??);
</code></pre>
<p>Ich hab hier ne Datei rumfliegen, in der angeblich die gesammte OLE-Struktur gespeichert wurde... nur steige ich nicht durch <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /><br />
Jedenfalls stammt das aus dieser Datei...</p>
<p>mfg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/831994</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/831994</guid><dc:creator><![CDATA[-**xXx**-]]></dc:creator><pubDate>Fri, 15 Jul 2005 19:25:15 GMT</pubDate></item><item><title><![CDATA[Reply to Formatierung in Excel on Wed, 27 Jul 2005 20:42:48 GMT]]></title><description><![CDATA[<p>Hallo -=]xXx[=-,</p>
<p>das mit diesem Code kann man wohl vergessen, ich habe es zumindest nicht hinbekommen.<br />
Über &quot;TextAlignment&quot; kann man zwar einiges anspechen, aber auch da bekomme ich oft Fehlermeldungen. Werde mal bei Gelegenheit schauen, ob ich das noch hinbekomme, meine Hauptfunktionen sind ja erfüllt.</p>
<p>Nochmals Danke an alle, die konstruktiv zum Thema beigetragen haben!</p>
<p>Dutchman</p>
]]></description><link>https://www.c-plusplus.net/forum/post/840379</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/840379</guid><dc:creator><![CDATA[Dutchman]]></dc:creator><pubDate>Wed, 27 Jul 2005 20:42:48 GMT</pubDate></item></channel></rss>