<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : [SOLVED]Reading RC-send Column names/data to Excel</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Report Control : [SOLVED]Reading RC-send Column names/data to Excel]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 13 May 2026 21:15:15 +0000</pubDate>
  <lastBuildDate>Mon, 11 Oct 2010 19:39:25 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=17398</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[[SOLVED]Reading RC-send Column names/data to Excel : Hi Aaron,Thank you very much for...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=17398&amp;PID=60798&amp;title=solvedreading-rcsend-column-names-data-to-excel#60798</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6028">mstuart</a><br /><strong>Subject:</strong> 17398<br /><strong>Posted:</strong> 11 October 2010 at 7:39pm<br /><br />Hi Aaron,<div>Thank you very much for your reply.&nbsp;Today I finally got it working.</div><div>I expanded on your code and here's how it came out.</div><div><br></div><div>What this VB6 code does is to extract the Column and Row objects and send the "data" to MS Excel.</div><div>=========================================</div><div><div>&nbsp;&nbsp; &nbsp;With oSheet</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;'// column names</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;r = 5 &nbsp; 'column names go into row 5</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;c = 0</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;For Each Column In RC.Columns</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;If Column.Visible = True And Column.Tag &lt;&gt; "&lt;Tag&gt;" Then</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;c = c + 1</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.Cells(r, c) = Column.Caption</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.Cells(r, c).Font.Bold = True</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Select Case Column.Alignment</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Case xtpAlignmentCenter</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.Columns(c).HorizontalAlignment = xlCenter</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Case xtpAlignmentRight</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.Columns(c).HorizontalAlignment = xlRight</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Case Else</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.Columns(c).HorizontalAlignment = xlLeft</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End Select</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End If</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;Next Column</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;'At this point if the record count &gt; 1000, make Excel visible</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;If RC.Records.Count &gt; 1000 Then</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oExcel.Visible = True</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;End If</div><div>&nbsp;&nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;'// rows</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;r = 6 &nbsp; 'row var</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;c = 0 &nbsp; 'column var</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;For Each Row In RC.Rows</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;If ExportSelected = True Then</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'// selected records only</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;If Row.Record.Item(1).Checked = True Then</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;For Each Column In RC.Columns</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;If Column.Visible = True And Column.Tag &lt;&gt; "&lt;Tag&gt;" Then</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;c = c + 1</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.Cells(r, c) = Row.Record(Column.ItemIndex).Value</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End If</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Next Column</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'increment Excel row number (r)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;r = r + 1</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'reset to 0 for each row (c)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;c = 0</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End If</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Else</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'// all records</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;For Each Column In RC.Columns</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;If Column.Visible = True And Column.Tag &lt;&gt; "&lt;Tag&gt;" Then</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;c = c + 1</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.Cells(r, c) = Row.Record(Column.ItemIndex).Value</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End If</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Next Column</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'increment Excel row number (r)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;r = r + 1</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'reset to 0 for each row (c)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;c = 0</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End If</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;Next Row</div><div>&nbsp;&nbsp; &nbsp;End With</div></div><div>=========================================</div><div><br></div>]]>
   </description>
   <pubDate>Mon, 11 Oct 2010 19:39:25 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=17398&amp;PID=60798&amp;title=solvedreading-rcsend-column-names-data-to-excel#60798</guid>
  </item> 
  <item>
   <title><![CDATA[[SOLVED]Reading RC-send Column names/data to Excel : Hi Mark,  If you want always...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=17398&amp;PID=60784&amp;title=solvedreading-rcsend-column-names-data-to-excel#60784</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3701">Aaron</a><br /><strong>Subject:</strong> 17398<br /><strong>Posted:</strong> 10 October 2010 at 6:13am<br /><br />Hi Mark,<DIV>&nbsp;</DIV><DIV>If you want always same postion of RecordItems loop the record collection. </DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp;&nbsp; Dim rec As ReportRecord<BR>&nbsp;&nbsp;&nbsp; Dim recItem As ReportRecordItem<BR>&nbsp;&nbsp;&nbsp; Dim row As ReportRow<BR>&nbsp;&nbsp;&nbsp; Dim col As ReportColumn<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp; For Each rec In Me.ReportControl1.Records<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; For Each recItem In rec<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Debug.Print recItem.Caption<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Every item has same position as you added it to RC<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Next recItem<BR>&nbsp;&nbsp;&nbsp; Next rec<BR></DIV><DIV>&nbsp;</DIV><DIV><DIV>Suppose user sorted or grouped columns and want to export the "visual" part (as user sees on screen) loop rows collection&nbsp;</DIV></DIV><DIV><BR>&nbsp;&nbsp;&nbsp; For Each row In Me.ReportControl1.Rows<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set rec = row.Record<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; For Each col In Me.ReportControl1.Columns<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Debug.Print rec(col.ItemIndex).Caption<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Next col<BR>&nbsp;&nbsp;&nbsp; Next row</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>Hope this helps <img src="http://forum.codejock.com/smileys/smiley2.gif" height="17" width="17" border="0" alt="Wink" title="Wink" /></DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Sun, 10 Oct 2010 06:13:09 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=17398&amp;PID=60784&amp;title=solvedreading-rcsend-column-names-data-to-excel#60784</guid>
  </item> 
  <item>
   <title><![CDATA[[SOLVED]Reading RC-send Column names/data to Excel :  Hi all,I&amp;#039;m building a VB6...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=17398&amp;PID=60773&amp;title=solvedreading-rcsend-column-names-data-to-excel#60773</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6028">mstuart</a><br /><strong>Subject:</strong> 17398<br /><strong>Posted:</strong> 08 October 2010 at 2:05pm<br /><br />Hi all,<div>I'm building a VB6 DLL method that will receive the RC object and read the column names and records, then populate Excel.<br><div>When the RC columns are moved to a different position or columns are removed, they don't match up in Excel with what is showing in the RC.</div><div><br></div><div>Here's a simple example.</div><div>Columns in original order: Check box, ID, Name, Manager, Type</div><div>The user clicks a button which runs VB6 code to load the column names and records to Excel. This works fine at this point. Columns and data are in the correct Excel columns.</div><div><br></div><div>The user then wants to change the order of the columns. They move the RC Type column in between Name and Manager. Now the RC column layout is:</div><div>Check box, ID, Name, Type, Manager</div><div><br></div><div>The user clicks the button again to send to Excel. The column names and record values go to Excel fine, but the data doesn't match up with the column name.</div></div><div><br></div><div>Here's some screen shots.</div><div><br></div><div>RC before column move:</div><div><img src="uploads/6028/RCOriginal.png" height="255" width="684" border="0" /><br></div><div><br></div><div>Excel before moving RC column:</div><div><img src="uploads/6028/ExcelOriginal.png" height="421" width="700" border="0" /><br></div><div><br></div><div>RC after moving column:</div><div><img src="uploads/6028/RCMove.png" height="255" width="684" border="0" /><br></div><div>Data appears correctly in RC object.</div><div><br></div><div>Excel after RC column move:</div><div><img src="uploads/6028/ExcelMove.png" height="404" width="689" border="0" /><br></div><div><br></div><div>In the screen shot above, notice the Type column contains the data for the Manager column.</div><div><br></div><div>This is the problem I'm having. The data doesn't match up with the column name.</div><div><br></div><div>Here's a partial VB6 code listing that reads the reportControl object, extracts the record data. populates Excel , then reads the Columns object and populates Excel with the column names.</div><div><br></div><div>==================================</div><div><div>&nbsp;&nbsp; &nbsp;ExportSelected = Me.ckExportSelected.Value</div><div>&nbsp;&nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp;With oSheet</div><div>&nbsp;&nbsp; &nbsp; &nbsp; If ExportSelected = True Then &nbsp; &nbsp; '// if records checked</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'preset the starting row for data</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;x = 6</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'read every record in the Records object</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;For i = 0 To RC.Records.Count - 1</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Set Record = RC.Records.Record(i)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'left most column should be the checkbox</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'check the state of it: 1=checked (ie: user selected the record)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;If Record.Item(0).CheckboxState = 1 Then</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;For j = 1 To RC.Columns.Count</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.Cells(x, j) = Record.Item(j - 1).Value</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Next j</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;x = x + 1</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End If</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Next i</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;Else &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; '// all records in view</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;For i = 0 To RC.Records.Count - 1</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Set Record = RC.Records.Record(i)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;For j = 1 To RC.Columns.Count</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.Cells(i + 6, j) = Record.Item(j - 1).Value</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Next j</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Next i</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;End If</div><div>&nbsp;&nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;'format Columns</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;For i = 0 To RC.Columns.Count - 1</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'set column title and set as Bold</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.Cells(5, i + 1) = RC.Columns(i).Caption</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.Cells(5, i + 1).Font.Bold = True</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'column alignment</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Select Case RC.Columns.Column(i).Alignment</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Case xtpAlignmentCenter</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.Columns(i + 1).HorizontalAlignment = xlCenter</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Case xtpAlignmentRight</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.Columns(i + 1).HorizontalAlignment = xlRight</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Case Else</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.Columns(i + 1).HorizontalAlignment = xlLeft</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End Select</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;Next i</div><div>&nbsp;&nbsp; &nbsp;End With</div></div><div>============================================</div><div>Maybe it would be better to read the columns in a For loop and inside that, read the Records object in a For loop.</div><div><br></div><div>Any help on this would be appreciated.</div><div><br></div><div>Regards,</div><div>Mark Stuart</div>]]>
   </description>
   <pubDate>Fri, 08 Oct 2010 14:05:26 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=17398&amp;PID=60773&amp;title=solvedreading-rcsend-column-names-data-to-excel#60773</guid>
  </item> 
 </channel>
</rss>