I have a macro that adds three rows of calculated data to a hole table. I'm using an Excel worksheet function for some of the calculations. When I add the data to the hole table with a loop, it is a long process.
I have other macros that add data to BOM tables that are very fast. Where is my issue?? Thank you for your help.
UPDATE: Adding the command "swHoleTable.EnableUpdate = False" doesn't help.
<p>Dim swHoleTable As SldWorks.HoleTable</p><p> Dim swTableAnn As SldWorks.TableAnnotation</p><p> Dim swHoleTableAnn As SldWorks.HoleTableAnnotation</p><p> Dim swAnn As SldWorks.Annotation</p><p></p><p> boolstatus = swModel.Extension.SelectByID2("Hole Table1", "HOLETABLE", 0, 0, 0, False, 0, Nothing, 0)</p><p> Set swHoleTable = swSelMgr.GetSelectedObject6(1, -1)</p><p> Set swHoleTableAnn = swHoleTable.GetTableAnnotations(0)</p><p> Set swTableAnn = swHoleTableAnn</p><p> If swTableAnn.ColumnCount < 7 Then</p><p> Call swTableAnn.SetColumnTitle(4, "DD")</p><p> Call swTableAnn.InsertColumn2(swTableItemInsertPosition_Last, 0, "DMS", swInsertColumn_DefaultWidth)</p><p> Call swTableAnn.InsertColumn2(swTableItemInsertPosition_Last, 0, "BC", swInsertColumn_DefaultWidth)</p><p> End If</p><p></p><p> ' Calculations happen here...</p><p> ' Slow text insertion loop</p><p> For I = 0 To UBound(dblTableData)</p><p> swTableAnn.Text(I + 1, 4) = CStr(dblTableData(I, 2))</p><p> swTableAnn.Text(I + 1, 5) = CStr(dblTableData(I, 3))</p><p> swTableAnn.Text(I + 1, 6) = CStr(dblTableData(I, 4))</p><p> Next I</p>SolidworksApi macros