Export table using VBA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi Dear,
I want to export the AutoCAD table to excel, I tried the below code which returns the cell value along with some unwanted texts. I want only the cell value. I have attached the drawing and the output. Please help me.
Public Sub transferTableValues_Excel()
Dim tTable1 As AcadTable
Dim tPickedPnt As Variant
Dim tVal As Variant
'select tables
On Error Resume Next 'in case no object or wrong object type is selected
Call ThisDrawing.Utility.GetEntity(tTable1, tPickedPnt, "Select Source-Table: ")
Dim tRow As Long
Dim tCol As Long
For tRow = 0 To tTable1.Rows - 1
For tCol = 0 To tTable1.Columns - 1
tVal = tTable1.GetText(tRow, tCol)
'tVal = tTable1.GetValue(tRow, tCol, 0)
Debug.Print (tVal)
Next
Next
End Sub
The unwanted texts are adding like this: {\fArial|b0|i0|c162|p34; \fArial TUR|b0|i0|c162|p34;}
Thanks
Murugan