<?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: Problem insert table to Autocad from Excel by VBA in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12974346#M444</link>
    <description>&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;That's right. Only I select not a range of data from a sheet, but a whole sheet from the list of sheets for example sheet No.1, 2, 3 etc. no range.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Aug 2024 09:08:26 GMT</pubDate>
    <dc:creator>malmal02122023</dc:creator>
    <dc:date>2024-08-22T09:08:26Z</dc:date>
    <item>
      <title>Problem insert table to Autocad from Excel by VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12938259#M425</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you help me please?&lt;/P&gt;&lt;P&gt;I try to insert the table to AutoCad from Excel but I have a problem with function definition&amp;nbsp; as shown below&lt;BR /&gt;AutoCad2019&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="malmal02122023_0-1722776600748.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1394168i08AA0FEF9C1FB9E6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="malmal02122023_0-1722776600748.png" alt="malmal02122023_0-1722776600748.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sub GetExcel()&lt;BR /&gt;'Excel&lt;BR /&gt;Dim wb As excel.workbook&lt;BR /&gt;Dim ws As excel.worksheet&lt;BR /&gt;Dim text As String&lt;BR /&gt;Set wb = GetExcelObject()&lt;BR /&gt;Set ws = wb.sheets("CAD")&lt;BR /&gt;'CAD&lt;BR /&gt;Dim vinsertionpoint As Variant&lt;BR /&gt;Dim lnumberofrows As Long&lt;BR /&gt;Dim lnumberofcolumns As Long&lt;BR /&gt;Dim otable As AcadTable&lt;BR /&gt;With ThisDrawing.Utility&lt;BR /&gt;vinsertionpoint = .GetPoint(, vbCr &amp;amp; "pick the insertion point: ")&lt;BR /&gt;End With&lt;BR /&gt;lnumberofrows = 6&lt;BR /&gt;lnumberofcolumns = 5&lt;BR /&gt;Set otable = ThisDrawing.ModelSpace.AddTable(vinsertionpoint, _&lt;BR /&gt;lnumberofrows, lnumberofcolumns, 5, 15)&lt;BR /&gt;otable.SetText 0, 0, "Emacro"&lt;BR /&gt;'excel -&amp;gt; CAD&lt;BR /&gt;text = ws.cells(1, 1)&lt;BR /&gt;ThisDrawing.Utility.Prompt (text) + vbNewLine&lt;BR /&gt;otable.SetText 1, 0, text&lt;/P&gt;&lt;P&gt;For irow = 1 To lnumberofrow - 1&lt;BR /&gt;For icolumn = 0 To lnumberofcolumn - 1&lt;BR /&gt;'text = cstr(irow) + "," + cstr(icolumn)&lt;BR /&gt;text = ws.cells(irow, icolumn + 1)&lt;BR /&gt;otable.SetText irow, icolumn, text&lt;BR /&gt;Next&lt;BR /&gt;Next&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Function GetExcelObject() As excel.workbook&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Dim wb As excel.workbook&lt;BR /&gt;Dim path As String&lt;BR /&gt;path = "C:\Users\amali\Downloads\TEST TABLE.xlsx"&lt;BR /&gt;Dim ret&lt;BR /&gt;ret = isworkbookopen(path)&lt;BR /&gt;If ret = True Then&lt;BR /&gt;Set wb = VBA.GetObject(path)&lt;BR /&gt;ThisDrawing.Utility.Prompt ("excel open") + vbNewLine&lt;BR /&gt;Else&lt;BR /&gt;Set wb = excel.workboks.Open(path)&lt;BR /&gt;ThisDrawing.Utility.Prompt ("excel closed") + vbNewLine&lt;BR /&gt;End If&lt;BR /&gt;Set getexcelobjet = wb&lt;BR /&gt;End Function&lt;BR /&gt;Function isworkbookopen(filename As String)&lt;BR /&gt;Dim ff As slong, errno As Long&lt;BR /&gt;On Error Resume Next&lt;BR /&gt;ff = FreeFile()&lt;BR /&gt;Open filename For Input Lock Read As #ff&lt;BR /&gt;Close ff&lt;BR /&gt;errno = Err&lt;BR /&gt;On Error GoTo 0&lt;BR /&gt;Select Case errno&lt;BR /&gt;Case 0: isworkbookopen = False&lt;BR /&gt;Case 70: isworkbookopen = True&lt;BR /&gt;Case Else: Error errno&lt;BR /&gt;End Select&lt;BR /&gt;End Function&lt;/P&gt;&lt;P&gt;Sub GE()&lt;BR /&gt;'excel&lt;BR /&gt;Dim wb As excel.workbook&lt;BR /&gt;Dim ws As excel.worksheet&lt;BR /&gt;Dim rg As excel.range&lt;BR /&gt;Dim text As String&lt;BR /&gt;Set wb = GetExcelObject()&lt;BR /&gt;Set ws = wb.sheets("Presupuesto")&lt;BR /&gt;'cad&lt;BR /&gt;Dim vinsertionpoint As Variant&lt;BR /&gt;Dim lnumberofrows As Long&lt;BR /&gt;Dim lnumberofcolumns As Long&lt;BR /&gt;Dim otable As AcadTable&lt;BR /&gt;On Error Resume Next&lt;BR /&gt;With ThisDrawing.Utility&lt;BR /&gt;vinsertionpoint = .GetPoint(, vbCr &amp;amp; "pick the insertion point: ")&lt;BR /&gt;End With&lt;BR /&gt;Lnumberorows = 5&lt;BR /&gt;lnumberofcolumns = 5&lt;BR /&gt;If Err Then Exit Sub&lt;BR /&gt;Set otable = ThisDrawing.ModelSpace.adtable(vinsertionpoint, _&lt;BR /&gt;Lnumberogrows, lnumberofcolumns, 5, 50)&lt;BR /&gt;text = ws.cells(1, 1)&lt;BR /&gt;This drawing.Utility.Prompt(text) + vbNewLine&lt;BR /&gt;otable.SetText 0, 0, "Presupuesto"&lt;BR /&gt;For irow = 1 To lnumberofrows&lt;BR /&gt;For icolumn = 1 To 5&lt;BR /&gt;Set rg = ws.cells(irow, icolumn)&lt;BR /&gt;text = rg.text&lt;BR /&gt;otable.SetText irow, icolumn - 1, text&lt;BR /&gt;Next&lt;BR /&gt;Next&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for advice&lt;/P&gt;&lt;P&gt;Best regards&lt;BR /&gt;Olek&lt;/P&gt;</description>
      <pubDate>Sun, 04 Aug 2024 13:06:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12938259#M425</guid>
      <dc:creator>malmal02122023</dc:creator>
      <dc:date>2024-08-04T13:06:24Z</dc:date>
    </item>
    <item>
      <title>Re: Problem insert table to Autocad from Excel by VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12940522#M426</link>
      <description>&lt;P&gt;You need to add a reference to excel. Tools&amp;gt;References.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 18:10:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12940522#M426</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2024-08-05T18:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: Problem insert table to Autocad from Excel by VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12940742#M427</link>
      <description>&lt;P&gt;Thank you, I have added the library, it works but&lt;BR /&gt;error 91&amp;nbsp;appears&lt;BR /&gt;Is it missing extra library or I need to rewrite the code?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Sub GetExcel()&lt;BR /&gt;'Excel&lt;BR /&gt;Dim wb As Excel.Workbook&lt;BR /&gt;Dim ws As Excel.Worksheet&lt;BR /&gt;Dim text As String&lt;BR /&gt;Set wb = GetExcelObject()&lt;BR /&gt;Set ws = wb.Sheets("CAD")&lt;BR /&gt;'CAD&lt;BR /&gt;Dim vinsertionpoint As Variant&lt;BR /&gt;Dim lnumberofrows As Long&lt;BR /&gt;Dim lnumberofcolumns As Long&lt;BR /&gt;Dim otable As AcadTable&lt;BR /&gt;With ThisDrawing.Utility&lt;BR /&gt;vinsertionpoint = .GetPoint(, vbCr &amp;amp; "pick the insertion point: ")&lt;BR /&gt;End With&lt;BR /&gt;lnumberofrows = 6&lt;BR /&gt;lnumberofcolumns = 5&lt;BR /&gt;Set otable = ThisDrawing.ModelSpace.AddTable(vinsertionpoint, _&lt;BR /&gt;lnumberofrows, lnumberofcolumns, 5, 15)&lt;BR /&gt;otable.SetText 0, 0, "Emacro"&lt;BR /&gt;'excel -&amp;gt; CAD&lt;BR /&gt;text = ws.Cells(1, 1)&lt;BR /&gt;ThisDrawing.Utility.Prompt (text) + vbNewLine&lt;BR /&gt;otable.SetText 1, 0, text&lt;/P&gt;&lt;P&gt;For irow = 1 To lnumberofrow - 1&lt;BR /&gt;For icolumn = 0 To lnumberofcolumn - 1&lt;BR /&gt;'text = cstr(irow) + "," + cstr(icolumn)&lt;BR /&gt;text = ws.Cells(irow, icolumn + 1)&lt;BR /&gt;otable.SetText irow, icolumn, text&lt;BR /&gt;Next&lt;BR /&gt;Next&lt;BR /&gt;End Sub&lt;BR /&gt;Function GetExcelObject() As Excel.Workbook&lt;BR /&gt;Dim wb As Excel.Workbook&lt;BR /&gt;Dim path As String&lt;BR /&gt;path = "C:\Users\amali\Downloads\TEST TABLE.xlsx"&lt;BR /&gt;Dim ret&lt;BR /&gt;ret = isworkbookopen(path)&lt;BR /&gt;If ret = True Then&lt;BR /&gt;Set wb = VBA.GetObject(path)&lt;BR /&gt;ThisDrawing.Utility.Prompt ("excel open") + vbNewLine&lt;BR /&gt;Else&lt;BR /&gt;Set wb = Excel.Workbooks.Open(path)&lt;BR /&gt;ThisDrawing.Utility.Prompt ("excel closed") + vbNewLine&lt;BR /&gt;End If&lt;BR /&gt;Set getexcelobjet = wb&lt;BR /&gt;End Function&lt;BR /&gt;Function isworkbookopen(filename As String)&lt;BR /&gt;Dim ff As Long, errno As Long&lt;BR /&gt;On Error Resume Next&lt;BR /&gt;ff = FreeFile()&lt;BR /&gt;Open filename For Input Lock Read As #ff&lt;BR /&gt;Close ff&lt;BR /&gt;errno = Err&lt;BR /&gt;On Error GoTo 0&lt;BR /&gt;Select Case errno&lt;BR /&gt;Case 0: isworkbookopen = False&lt;BR /&gt;Case 70: isworkbookopen = True&lt;BR /&gt;Case Else: Error errno&lt;BR /&gt;End Select&lt;BR /&gt;End Function&lt;/P&gt;&lt;P&gt;Sub GE()&lt;BR /&gt;'excel&lt;BR /&gt;Dim wb As Excel.Workbook&lt;BR /&gt;Dim ws As Excel.Worksheet&lt;BR /&gt;Dim rg As Excel.Range&lt;BR /&gt;Dim text As String&lt;BR /&gt;Set wb = GetExcelObject()&lt;BR /&gt;Set ws = wb.Sheets("Presupuesto")&lt;BR /&gt;'cad&lt;BR /&gt;Dim vinsertionpoint As Variant&lt;BR /&gt;Dim lnumberofrows As Long&lt;BR /&gt;Dim lnumberofcolumns As Long&lt;BR /&gt;Dim otable As AcadTable&lt;BR /&gt;On Error Resume Next&lt;BR /&gt;With ThisDrawing.Utility&lt;BR /&gt;vinsertionpoint = .GetPoint(, vbCr &amp;amp; "pick the insertion point: ")&lt;BR /&gt;End With&lt;BR /&gt;Lnumberorows = 5&lt;BR /&gt;lnumberofcolumns = 5&lt;BR /&gt;If Err Then Exit Sub&lt;BR /&gt;Set otable = ThisDrawing.ModelSpace.adtable(vinsertionpoint, _&lt;BR /&gt;Lnumberogrows, lnumberofcolumns, 5, 50)&lt;BR /&gt;text = ws.Cells(1, 1)&lt;BR /&gt;ThisDrawing.Utility.Prompt (text) + vbNewLine&lt;BR /&gt;otable.SetText 0, 0, "Presupuesto"&lt;BR /&gt;For irow = 1 To lnumberofrows&lt;BR /&gt;For icolumn = 1 To 5&lt;BR /&gt;Set rg = ws.Cells(irow, icolumn)&lt;BR /&gt;text = rg.text&lt;BR /&gt;otable.SetText irow, icolumn - 1, text&lt;BR /&gt;Next&lt;BR /&gt;Next&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="malmal02122023_0-1722888818766.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1394629i9C064626394EC6CF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="malmal02122023_0-1722888818766.png" alt="malmal02122023_0-1722888818766.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="malmal02122023_1-1722888845052.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1394630iCA549D69E64642CD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="malmal02122023_1-1722888845052.png" alt="malmal02122023_1-1722888845052.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 20:16:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12940742#M427</guid>
      <dc:creator>malmal02122023</dc:creator>
      <dc:date>2024-08-05T20:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: Problem insert table to Autocad from Excel by VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12940969#M428</link>
      <description>&lt;P&gt;You need to step through function GetExcelObject() in debugging mode to see why it returns Nothing. Since you did not show the code of the function VBA.GetObject(path as String), no one, but you, can tell what goes wrong.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, please post your code by using "&amp;lt;/&amp;gt;" button, so the code is easily readable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 23:29:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12940969#M428</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2024-08-05T23:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: Problem insert table to Autocad from Excel by VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12942278#M429</link>
      <description>&lt;P&gt;Your code is poorly organized to begin with, and when you don't post it in a code window, it makes it even harder to read. Please click on the 3 vertical dots and select Edit Post and then use this to &lt;A href="https://forums.autodesk.com/t5/vba/post-your-code/td-p/12324653/jump-to/first-unread-message" target="_blank" rel="noopener"&gt;post your code&lt;/A&gt;. Then I will be better able to comment on your code.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2024 14:52:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12942278#M429</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2024-08-06T14:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: Problem insert table to Autocad from Excel by VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12942511#M430</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="visual-basic"&gt;Sub GetExcel()
  'Excel
  Dim wb As Excel.Workbook
  Dim ws As Excel.Worksheet
  Dim text As String
  Set wb = GetExcelObject()
  Set ws = wb.Sheets("CAD")
  'CAD
  Dim vinsertionpoint As Variant
  Dim lnumberofrows As Long
  Dim lnumberofcolumns As Long
  Dim otable As AcadTable
  With ThisDrawing.Utility
    vinsertionpoint = .GetPoint(, vbCr &amp;amp; "pick the insertion point: ")
  End With
  lnumberofrows = 6
  lnumberofcolumns = 5
  Set otable = ThisDrawing.ModelSpace.AddTable(vinsertionpoint, _
  lnumberofrows, lnumberofcolumns, 5, 15)
  otable.SetText 0, 0, "Emacro"
  'excel -&amp;gt; CAD
  text = ws.Cells(1, 1)
  ThisDrawing.Utility.Prompt (text) + vbNewLine
  otable.SetText 1, 0, text

  For irow = 1 To lnumberofrow - 1
    For icolumn = 0 To lnumberofcolumn - 1
      'text = cstr(irow) + "," + cstr(icolumn)
      text = ws.Cells(irow, icolumn + 1)
      otable.SetText irow, icolumn, text
    Next
  Next
End Sub


Function GetExcelObject() As Excel.Workbook
  Dim wb As Excel.Workbook
  Dim path As String
  path = "C:\Users\amali\Downloads\TEST TABLE.xlsx"
  Dim ret
  ret = isworkbookopen(path)
  If ret = True Then
    Set wb = VBA.GetObject(path)
    ThisDrawing.Utility.Prompt ("excel open") + vbNewLine
  Else
    Set wb = Excel.Workbooks.Open(path)
    ThisDrawing.Utility.Prompt ("excel closed") + vbNewLine
  End If
  Set getexcelobjet = wb
End Function


Function isworkbookopen(filename As String)
  Dim ff As Long, errno As Long
  On Error Resume Next
  ff = FreeFile()
  Open filename For Input Lock Read As #ff
  Close ff
  errno = Err
  On Error GoTo 0
  Select Case errno
    Case 0: isworkbookopen = False
    Case 70: isworkbookopen = True
    Case Else: Error errno
  End Select
End Function

Sub GE()
  'excel
  Dim wb As Excel.Workbook
  Dim ws As Excel.Worksheet
  Dim rg As Excel.Range
  Dim text As String
  Set wb = GetExcelObject()
  Set ws = wb.Sheets("Presupuesto")
  'cad
  Dim vinsertionpoint As Variant
  Dim lnumberofrows As Long
  Dim lnumberofcolumns As Long
  Dim otable As AcadTable
  On Error Resume Next
  With ThisDrawing.Utility
    vinsertionpoint = .GetPoint(, vbCr &amp;amp; "pick the insertion point: ")
  End With
  Lnumberorows = 5
  lnumberofcolumns = 5
  If Err Then Exit Sub
  Set otable = ThisDrawing.ModelSpace.adtable(vinsertionpoint, _
  Lnumberogrows, lnumberofcolumns, 5, 50)
  text = ws.Cells(1, 1)
  ThisDrawing.Utility.Prompt (text) + vbNewLine
  otable.SetText 0, 0, "Presupuesto"
  For irow = 1 To lnumberofrows
    For icolumn = 1 To 5
      Set rg = ws.Cells(irow, icolumn)
      text = rg.text
      otable.SetText irow, icolumn - 1, text
    Next
  Next
End Sub&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please take a look,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2024 17:02:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12942511#M430</guid>
      <dc:creator>malmal02122023</dc:creator>
      <dc:date>2024-08-06T17:02:01Z</dc:date>
    </item>
    <item>
      <title>Re: Problem insert table to Autocad from Excel by VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12942548#M431</link>
      <description>&lt;P&gt;I edited your code to add indenting. It makes it even easier to read by indicating the hierarchical structure. I don't know that you need all those functions. There is some redundancy. Also, you've taken my GetExcel function and added stuff to it that doesn't match the purpose of the function which is to get an excel application object, not a workbook. A function should always only do one thing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need to add to that function's capability, then create a new function that calls the first one. The reasoning behind this is to be able to test small blocks of code. Once you test a block of code, then you don't have to keep testing it. But if you put everything together all tangled like spaghetti, then its really hard to test your code. It also makes your code reusable, by making it available to other subs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another tip, xl has a problem that requires you to dispose of xl objects in the reverse order in which they were created. Otherwise they will always stay in memory. For example:&lt;/P&gt;
&lt;P&gt;new xl app&lt;/P&gt;
&lt;P&gt;&amp;nbsp; new workbook&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; new worksheet&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do your work&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; worksheet = Nothing&lt;/P&gt;
&lt;P&gt;&amp;nbsp; workbook = Nothing&lt;/P&gt;
&lt;P&gt;app = Nothing&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2024 18:25:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12942548#M431</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2024-08-06T18:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: Problem insert table to Autocad from Excel by VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12945145#M432</link>
      <description>&lt;P&gt;I couldn't test it because I don't have your drawing or spreadsheet but the below code should work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;Public Function GetXL() As Excel.Application
    On Error Resume Next
    Dim xlApp As Excel.Application
    Set xlApp = GetObject(, "Excel.Application")
    If xlApp Is Nothing Then
        Set xlApp = CreateObject("Excel.Application")
    End If
    Set GetXL = xlApp
End Function

Sub AddTableFromXL()
  'excel
  Dim xl As Excel.Application
  Dim wb As Excel.Workbook
  Dim ws As Excel.Worksheet
  Dim rg As Excel.Range
  Dim text As String
  
  Set xl = GetXL()
  'open readonly avoids checking for open file. You're only copying info anyway.
  Set wb = xl.Workbooks.Open("C:\Users\amali\Downloads\TEST TABLE.xlsx", , True)
  Set ws = wb.Sheets("Presupuesto")
  
  'cad
  Dim vinsertionpoint As Variant
  Dim lnumberofrows As Long
  Dim lnumberofcolumns As Long
  Dim otable As AcadTable
  On Error Resume Next
  With ThisDrawing.Utility
    vinsertionpoint = .GetPoint(, vbCr &amp;amp; "pick the insertion point: ")
  End With
  Lnumberorows = 5
  lnumberofcolumns = 5
  If Err Then Exit Sub
    Set otable = ThisDrawing.ModelSpace.adtable(vinsertionpoint, _
    Lnumberogrows, lnumberofcolumns, 5, 50)
    text = ws.Cells(1, 1)
    ThisDrawing.Utility.Prompt (text) + vbNewLine
    otable.SetText 0, 0, "Presupuesto"
    For irow = 1 To lnumberofrows
      For icolumn = 1 To 5
        Set rg = ws.Cells(irow, icolumn)
        text = rg.text
        otable.SetText irow, icolumn - 1, text
      Next
    Next
    
    'dispose
    Set rg = Nothing
    Set ws = Nothing
    Set wb = Nothing
    Set xl = Nothing
End Sub
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 18:56:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12945145#M432</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2024-08-07T18:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: Problem insert table to Autocad from Excel by VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12945439#M433</link>
      <description>&lt;P&gt;Thank you very much for help. I have corrected my code, it works. I tried to run your code but it didn't insert the table and didn't give any errors.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Sub GetExcel()
  'Excel
  Dim wb As Excel.Workbook
  Dim ws As Excel.Worksheet
  Dim text As String
  Set wb = GetExcelObject()
  Set ws = wb.Sheets("CAD")
  
  'CAD
  Dim vinsertionpoint As Variant
  Dim lnumberofrows As Long
  Dim lnumberofcolumns As Long
  Dim otable As AcadTable
  
  With ThisDrawing.Utility
    vinsertionpoint = .GetPoint(, vbCr &amp;amp; "pick the insertion point: ")
  End With
  
  lnumberofrows = 6
  lnumberofcolumns = 5
  
  Set otable = ThisDrawing.ModelSpace.AddTable(vinsertionpoint, _
  lnumberofrows, lnumberofcolumns, 5, 15)
  
  otable.SetText 0, 0, "Emacro"
  'excel -&amp;gt; CAD
  text = ws.Cells(1, 1)
  ThisDrawing.Utility.Prompt (text) + vbNewLine
  otable.SetText 1, 0, text
  
  
  For irow = 1 To lnumberofrows - 1
  
    For icolumn = 0 To lnumberofcolumns - 1
      'text = cstr(irow) + "," + cstr(icolumn)
      text = ws.Cells(irow, icolumn + 1)
      otable.SetText irow, icolumn, text
    Next
  Next
End Sub


Function GetExcelObject() As Excel.Workbook

      Dim wb As Excel.Workbook
      
      Dim path As String
      path = "C:\Users\amali\Downloads\TEST TABLE.xlsx"
      
      Dim ret
      
      ret = isworkbookopen(path)
      
      If ret = True Then
      Set wb = VBA.GetObject(path)
      ThisDrawing.Utility.Prompt ("excel open") + vbNewLine
       Else
        Set wb = Excel.Workbooks.Open(path)
        ThisDrawing.Utility.Prompt ("excel closed") + vbNewLine
      End If
      
      Set GetExcelObject = wb
    End Function

    Function isworkbookopen(filename As String)
      Dim ff As Long, errno As Long
      
      On Error Resume Next
      ff = FreeFile()
      Open filename For Input Lock Read As #ff
      Close ff
      errno = Err
      On Error GoTo 0
      
       Select Case errno
        Case 0: isworkbookopen = False
        Case 70: isworkbookopen = True
        Case Else: Error errno
      End Select
    End Function
    
    Sub GE()
      'excel
       Dim wb As Excel.Workbook
       Dim ws As Excel.Worksheet
       Dim rg As Excel.Range
       Dim text As String
       Set wb = GetExcelObject()
      Set ws = wb.Sheets("Presupuesto")
      
      'cad
      Dim vinsertionpoint As Variant
      Dim lnumberofrows As Long
      Dim lnumberofcolumns As Long
      Dim otable As AcadTable
      
       On Error Resume Next
       
      With ThisDrawing.Utility
        vinsertionpoint = .GetPoint(, vbCr &amp;amp; "pick the insertion point: ")
      End With
      
      lnumberofrows = 5
      lnumberofcolumns = 5
      
      If Err Then Exit Sub
      
       Set otable = ThisDrawing.ModelSpace.addtable(vinsertionpoint, _
       lnumberofrows, lnumberofcolumns, 5, 50)
       
       text = ws.Cells(1, 1)
       ThisDrawing.Utility.Prompt (text) + vbNewLine
       
       otable.SetText 0, 0, "Presupuesto"
       
       
       For irow = 1 To lnumberofrows
     
        For icolumn = 1 To 5
           Set rg = ws.Cells(irow, icolumn)
           text = rg.text
           otable.SetText irow, icolumn - 1, text
         Next
       Next
     End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 21:16:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12945439#M433</guid>
      <dc:creator>malmal02122023</dc:creator>
      <dc:date>2024-08-07T21:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: Problem insert table to Autocad from Excel by VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12945452#M434</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14815588"&gt;@malmal02122023&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you very much for help. I have corrected my code, it works. I tried to run your code but it didn't insert the table and didn't give any errors.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I told you, I wasn't able to test the table part because I don't have your spreadsheet.If you post a sample of your spreadsheet, I might be able to test it. But it's probably because of your use of On Error and checking for the Err object.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your code is very messy. It creates xl objects many times, unnecessarily. and you don't dispose of the objects when you are done. To see what I mean, start TaskManager and I bet you will see that there are many instances of Excel still running. You now have to use Task Manager to end all those tasks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 21:27:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12945452#M434</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2024-08-07T21:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: Problem insert table to Autocad from Excel by VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12945456#M435</link>
      <description>&lt;P&gt;Please see the example table in attachment.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 21:33:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12945456#M435</guid>
      <dc:creator>malmal02122023</dc:creator>
      <dc:date>2024-08-07T21:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: Problem insert table to Autocad from Excel by VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12949594#M436</link>
      <description>&lt;P&gt;I have a question. Is it possible to delete the row - title in the&amp;nbsp; table &lt;SPAN class=""&gt;so that only dates&amp;nbsp; and header remain&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;or better to create table from a&amp;nbsp; data link by vba but I just don't know where to start.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 15:06:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12949594#M436</guid>
      <dc:creator>malmal02122023</dc:creator>
      <dc:date>2024-08-09T15:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: Problem insert table to Autocad from Excel by VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12950225#M437</link>
      <description>&lt;P&gt;What I would recommend is to create a table style that doesn't have a Tile row, and then after you do ModelSpace.AddTable, assign the TableStyle to the table. The easiest way to do this is add a table. Then delete the Title row. Now select the table, right-click&amp;gt;Table Style&amp;gt;Save as new table style.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 21:29:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12950225#M437</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2024-08-09T21:29:26Z</dc:date>
    </item>
    <item>
      <title>Re: Problem insert table to Autocad from Excel by VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12950299#M438</link>
      <description>&lt;P&gt;Addition to what&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14801"&gt;@Ed__Jobe&lt;/a&gt;&amp;nbsp;said (since you mentioned DataLink):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using DataLink to connect data between AutoCAD's table and Excel sheet (which can update data in both direction) you still need to create a AutoCAD table, manually, or by code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately, VBA does not have API to manipulate DataLink. You can use AutoCAD .NET API to connect/update table with DataLink, if you do .NET API programming (time to leave VBA behind?).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 22:31:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12950299#M438</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2024-08-09T22:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: Problem insert table to Autocad from Excel by VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12950327#M439</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14815588"&gt;@malmal02122023&lt;/a&gt; I didn't catch that you wanted a datalink. Anyway, here is some working code and a modified spreadsheet that has tables defined to create named ranges that you can refer to from acad. Here are some other problems that you had in your code.&lt;/P&gt;
&lt;P&gt;1. many misspelled variables. Always use Option Explicit in the top of your modules to have the compiler catch these errors. Similarly, you misspelled some object methods.&lt;/P&gt;
&lt;P&gt;2. Don't test for Err, it always exists. Test for Err.Number&amp;gt;0 or some other value.&lt;/P&gt;
&lt;P&gt;3. Don't use On Error to get user input. Test for a condition.&lt;/P&gt;
&lt;P&gt;4. AddTable was misspelled as adTable&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="visual-basic"&gt;Option Explicit


Sub AddTableFromXL()
    On Error GoTo Err_Control
    'excel
    Dim xl As Excel.Application
    Dim wb As Excel.Workbook
    Dim ws As Excel.Worksheet
    Dim rg As Excel.Range
    Dim path As String
    Dim text As String
    
    Set xl = GetXL()
    path = "C:\Users\username\Downloads\TEST TABLE.xlsx"
    'open readonly.
    Set wb = xl.Workbooks.Open(path, , True)
WbSet:
    Set ws = wb.Sheets("CAD")
    Set rg = ws.Range("Table1")
    
    'cad
    Dim vInsertionPoint1 As Variant
    Dim vInsertionPoint2(0 To 2) As Double
    Dim oTable As AcadTable
    Dim iRow As Integer
    Dim iColumn As Integer
    Dim oText As String
    
GetIP:
    With ThisDrawing.Utility
        vInsertionPoint1 = .GetPoint(, vbCr &amp;amp; "Pick the table insertion point: ")
    End With
    
    ThisDrawing.SetVariable "CTABLESTYLE", "NoTitle"
    'Add an extra row to account for table title row.
    Set oTable = ThisDrawing.ModelSpace.AddTable(vInsertionPoint1, rg.Rows.Count + 2, rg.Columns.Count, 0.25, 2)
    'Delete table title row
    oTable.DeleteRows 0, 1
    For iRow = 0 To rg.Rows.Count
        For iColumn = 1 To rg.Columns.Count
            oText = rg.Cells(iRow, iColumn)
            oTable.SetText iRow, iColumn - 1, oText
        Next
    Next
    
    Set ws = wb.Sheets("PRESUPUESTO")
    Set rg = ws.Range("Table2")
    ThisDrawing.SetVariable "CTABLESTYLE", "STANDARD"
    'new table 12 units to the right
    vInsertionPoint2(0) = vInsertionPoint1(0) + 12: vInsertionPoint2(1) = vInsertionPoint1(1): vInsertionPoint2(2) = vInsertionPoint1(2)
    'Add an extra row to account for table title row.
    Set oTable = ThisDrawing.ModelSpace.AddTable(vInsertionPoint2, rg.Rows.Count + 2, rg.Columns.Count, 0.25, 2)
    'Delete table title row
    oTable.DeleteRows 0, 1
    For iRow = 0 To rg.Rows.Count
        For iColumn = 1 To rg.Columns.Count
            oText = rg.Cells(iRow, iColumn)
            oTable.SetText iRow, iColumn - 1, oText
        Next
    Next
      
Exit_Here:
    'Cleanup xl objects
    Set rg = Nothing
    Set ws = Nothing
    Set wb = Nothing
    Set xl = Nothing
    Exit Sub
Err_Control:
    Select Case Err.Number
    'Add your Case selections here
    Case Is = 1000
        'User didn't select a valid point
        Err.Clear
        Resume GetIP
    Case Is = 1004
        'File is already open, just get it.
        Err.Clear
        Set wb = xl.Workbooks("TEST TABLE.xlsx")
        Resume WbSet
    Case Else
        MsgBox Err.Number &amp;amp; ", " &amp;amp; Err.Description, , "AddTableFromXL"
        Err.Clear
        Resume Exit_Here
    End Select
End Sub

Public Function GetXL() As Excel.Application
    On Error Resume Next
    Dim xlApp As Excel.Application
    Set xlApp = GetObject(, "Excel.Application")
    If xlApp Is Nothing Then
        Set xlApp = CreateObject("Excel.Application")
    End If
    Set GetXL = xlApp
End Function&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 22:57:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12950327#M439</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2024-08-09T22:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: Problem insert table to Autocad from Excel by VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12965109#M440</link>
      <description>&lt;P&gt;Thank you for advice to use AutoCad NET API.&amp;nbsp;&lt;BR /&gt;For data link ecxel spreadsheet I used&amp;nbsp;AutoCad NET API C# code.&lt;/P&gt;&lt;P&gt;I'm facing a problem defining variables i and j - row and columns number as shown below:&lt;BR /&gt;&lt;SPAN&gt;tb.SetAlignment(i, j,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;CellAlignment&lt;/SPAN&gt;&lt;SPAN&gt;.MiddleCenter);&lt;BR /&gt;&lt;/SPAN&gt;How can I determine variables if the number of rows and columns is taken from Excel by data link?&lt;/P&gt;</description>
      <pubDate>Sat, 17 Aug 2024 22:59:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12965109#M440</guid>
      <dc:creator>malmal02122023</dc:creator>
      <dc:date>2024-08-17T22:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: Problem insert table to Autocad from Excel by VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12970651#M441</link>
      <description>&lt;P&gt;If you want to use DataLink to connect data in Excelsheet to a table entity in AutoCAD with .NET API, you need to either have a existing DataLink in drawing already, or create one with code, then, you need to have a AutoCAD table entity created, then you can call Table.SetDataLink(rowIndex, columnIndex, dataLinkObject, true/false); that is specify a range of cells in the table to connect data in the DataLink, which represents the data in a range of cell of the spreadsheet. I am not sure Table.SetAlignment() has anything to do with DataLink here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you call SetDataLink with starting row index and starting column index, you do not have to worry/know how many row/columns of data exist in the spreadsheet. the AutoCAD table would automatically expand its rows/columns to hold the data. However, you should get the source data's row/column information from DataLink.ConnectionoString property, or you can define the source's rows/columns to be connected via DataLink.ConnectionString property.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tip: you can manually define a DataLink when create a table in AutoCAD and save the drawing. Then you can write some test code agist this drawing to find the existing DataLink and examine its ConnectionString property.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since this is VBA/COM API forum, DataLink is a topic off this forum. If you go to .NET discussion forum and search for "DataLink", you may find a few past discussion with code samples.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2024 19:17:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12970651#M441</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2024-08-20T19:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: Problem insert table to Autocad from Excel by VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12973417#M442</link>
      <description>&lt;P&gt;After adding a table to a drawing, I try to change the table format. In the Excel table there is a table with 9 rows that is exported to AutoCAD by Datalink.&amp;nbsp;So i want to know how to determine the number of rows.&amp;nbsp;Or is it possible to assign a "header" (without title) only to the first line and a "data" to the rest in a different way also for cells margin and text? From what I was able to find, I can format a table by defining the number of columns and rows [i, j].&lt;/P&gt;&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt; for (int i = 0; i &amp;lt; 9; i++)
 {
     for (int j = 0; j &amp;lt; 12; j++)
     {

         tb.Cells[i, j].Style = "Data";
         tb.Cells[0, j].Style = "Header";

         
         tb.Cells[i, j].Borders.Top.Margin = 0.2;
         tb.Cells[i, j].Borders.Bottom.Margin = 0.2;

         tb.SetRowHeight(i, 6.8);

         tb.Cells[i, j].TextHeight = 3.5;
         tb.Cells[i, j].Alignment =
         CellAlignment.MiddleCenter;

         
     }
 }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2024 21:53:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12973417#M442</guid>
      <dc:creator>malmal02122023</dc:creator>
      <dc:date>2024-08-21T21:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: Problem insert table to Autocad from Excel by VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12973441#M443</link>
      <description>&lt;P&gt;You're trying to overthink it. You don't understand how datalink and tables work. Do it manually first or read up on it in Help. Use the DATALINK command and select a named range or the print area to link to. Then insert a table and select the DataLink option. The whole table is filled out automatically and updates if the spreadsheet is edited.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2024 22:15:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12973441#M443</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2024-08-21T22:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: Problem insert table to Autocad from Excel by VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12974346#M444</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;That's right. Only I select not a range of data from a sheet, but a whole sheet from the list of sheets for example sheet No.1, 2, 3 etc. no range.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2024 09:08:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/problem-insert-table-to-autocad-from-excel-by-vba/m-p/12974346#M444</guid>
      <dc:creator>malmal02122023</dc:creator>
      <dc:date>2024-08-22T09:08:26Z</dc:date>
    </item>
  </channel>
</rss>

