Здравствуйте, подскажите кто может сталкивался с подобным, как в данном случае вставить разделительную строку в таблицу если sel_obj(w).Layer не равен sel_obj(w + 1).Layer
Что неужели нужно selectionset разбивать для этого
?
Option Explicit
Sub FS_MyTable_act2()
Dim fskdataType As Integer
Dim fskdata As Variant
Dim AP As Excel.Application
Dim WB As Excel.Workbook
Dim WS As Excel.Worksheet
Dim FPath, str_FPath, FName As String
Dim C_str, z, pos_my_name As Integer
Dim MyTable As AcadTable
Dim la_r, my_name, mat_l As String
ReDim sel_obj(0 To fs_sel.Count - 1) As AcadEntity
ReDim p(0 To fs_sel.Count - 1) As Integer
Dim j, w, m As Integer
Set AP = Excel.Application
Set WB = Excel.Workbooks.Add("***")
Set WS = Excel.Worksheets("***")
FPath = ThisDrawing.Path
FName = ThisDrawing.Name
C_str = Len(FName) - 4
FName = Left(FName, C_str)
str_FPath = FPath & "/" & FName & ". ***" & ".xlsx"
z = 4
For w = 0 To fs_sel.Count - 1
Set sel_obj(w) = fs_sel.Item(w)
la_r = sel_obj(w).Layer
pos_my_name = InStr(la_r, " ")
mat_l = Mid(la_r, 2, pos_my_name - 2)
z = z + 1
sel_obj(w).GetXData "FS_Count", fskdataType, fskdata
my_name = Mid(la_r, pos_my_name, Len(la_r) + 1 - pos_my_name)
WS.Cells(z, 2) = mat_l
WS.Cells(z, 4) = my_name
WS.Cells(z, 5) = fskdata(2)
Next
WB.SaveAs (str_FPath)
AP.Quit
End Sub