<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Export table using VBA in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/export-table-using-vba/m-p/11198246#M2454</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14801"&gt;@Ed__Jobe&lt;/a&gt;&amp;nbsp;, can you please help me with the VBA code?.. I tried but, I was unable to get it done correctly.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If possible, please help me to export it as CSV file.&amp;nbsp;Thanks, in advance&lt;/P&gt;</description>
    <pubDate>Fri, 27 May 2022 17:51:23 GMT</pubDate>
    <dc:creator>murugasubi</dc:creator>
    <dc:date>2022-05-27T17:51:23Z</dc:date>
    <item>
      <title>Export table using VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/export-table-using-vba/m-p/11198211#M2452</link>
      <description>&lt;P&gt;Hi Dear,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to export the AutoCAD table to excel, I tried the below code which returns the cell value along with some unwanted texts.&amp;nbsp; I want only the cell value. I have attached the drawing and the output. Please help me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Public Sub transferTableValues_Excel()&lt;BR /&gt;&lt;BR /&gt;Dim tTable1 As AcadTable&lt;BR /&gt;Dim tPickedPnt As Variant&lt;BR /&gt;Dim tVal As Variant&lt;BR /&gt;&lt;BR /&gt;'select tables&lt;BR /&gt;On Error Resume Next 'in case no object or wrong object type is selected&lt;BR /&gt;Call ThisDrawing.Utility.GetEntity(tTable1, tPickedPnt, "Select Source-Table: ")&lt;/P&gt;&lt;P&gt;Dim tRow As Long&lt;BR /&gt;Dim tCol As Long&lt;BR /&gt;For tRow = 0 To tTable1.Rows - 1&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; For tCol = 0 To tTable1.Columns - 1&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;tVal = tTable1.GetText(tRow, tCol)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;'tVal = tTable1.GetValue(tRow, tCol, 0)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Debug.Print (tVal)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Next&lt;BR /&gt;Next&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The unwanted texts are adding like this:&amp;nbsp;{\fArial|b0|i0|c162|p34;&amp;nbsp; &amp;nbsp;&amp;nbsp;\fArial TUR|b0|i0|c162|p34;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Murugan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2022 17:28:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/export-table-using-vba/m-p/11198211#M2452</guid>
      <dc:creator>murugasubi</dc:creator>
      <dc:date>2022-05-27T17:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: Export table using VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/export-table-using-vba/m-p/11198220#M2453</link>
      <description>&lt;P&gt;Those are mtext formatting codes. You need to use string manipulation functions like Mid() to strip out what you need.&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2022 17:35:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/export-table-using-vba/m-p/11198220#M2453</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2022-05-27T17:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: Export table using VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/export-table-using-vba/m-p/11198246#M2454</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14801"&gt;@Ed__Jobe&lt;/a&gt;&amp;nbsp;, can you please help me with the VBA code?.. I tried but, I was unable to get it done correctly.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If possible, please help me to export it as CSV file.&amp;nbsp;Thanks, in advance&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2022 17:51:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/export-table-using-vba/m-p/11198246#M2454</guid>
      <dc:creator>murugasubi</dc:creator>
      <dc:date>2022-05-27T17:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: Export table using VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/export-table-using-vba/m-p/11198357#M2455</link>
      <description>&lt;P&gt;it requires knowing your data, which I don't. But, example, you could use the MID function to return a part of the string that represents the cell contents. You just need to tell the function where to start and end the sequence. You could also, study the pattern of codes and search the whole string for those parts. You can then use the Left and Right functions to help you figure out what you need. Note that the mtext starts and ends with curyly braces and the codes are separated by vertical pipe characters.&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2022 18:54:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/export-table-using-vba/m-p/11198357#M2455</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2022-05-27T18:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: Export table using VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/export-table-using-vba/m-p/11198425#M2456</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3688371"&gt;@murugasubi&lt;/a&gt;&amp;nbsp;Sorry to reply with silly answer but did you tried to export it with tableexport command manually or by a simple lsp. Result will be a csv file without formatting text code.&lt;/P&gt;&lt;P&gt;But if you have a lot of dwg may be complicate do it manually.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:tabx()
	(command "tableexport" "" "test.csv")
	(princ "\nTable Export Complete:")
	(princ)
) ;_end of defun&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2022 19:25:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/export-table-using-vba/m-p/11198425#M2456</guid>
      <dc:creator>grobnik</dc:creator>
      <dc:date>2022-05-27T19:25:57Z</dc:date>
    </item>
    <item>
      <title>Re: Export table using VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/export-table-using-vba/m-p/11198491#M2457</link>
      <description>&lt;P&gt;You might have a look at &lt;A href="https://forums.autodesk.com/t5/vba/mtext-format-codes/m-p/356713" target="_blank" rel="noopener"&gt;this thread&lt;/A&gt;. Using the regex in the last post, I came up with this sample below. However, the regex didn't work. You can play around with it to find the right expression.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;'You must register Microsoft VBScript Regular Expression 5.5

Sub RegexTestMtext()
    Dim rg As New RegExp
    Dim str As String
    With rg
        .Global = True
        .MultiLine = True
        .IgnoreCase = False
        .Pattern = "\\[A-Za-z0-9.\/\#\^]+;"
    End With
    str = "{\fArial|b0|i0|c0|p34;weight}"
    If rg.test(str) Then
        Debug.Print rg.Replace(str, "$1")
    Else
        Debug.Print "No Match"
    End If
End Sub&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2022 20:03:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/export-table-using-vba/m-p/11198491#M2457</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2022-05-27T20:03:15Z</dc:date>
    </item>
    <item>
      <title>Re: Export table using VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/export-table-using-vba/m-p/11198575#M2458</link>
      <description>&lt;P&gt;I also found &lt;A href="https://www.theswamp.org/index.php?topic=31584.0" target="_blank" rel="noopener"&gt;this thread&lt;/A&gt; at the Swamp that has a lisp routine that uses regex to strip the format codes. Sorry, but I don't have any more time to test this out. Let us know if you solve your problem.&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2022 20:38:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/export-table-using-vba/m-p/11198575#M2458</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2022-05-27T20:38:25Z</dc:date>
    </item>
  </channel>
</rss>

