I have the code to select the table, but how would I select a particular cell in the table and then update it with a value? Here is my code to display the table values but I have no idea how to update any of the table values. Any help would be appreciated... Thx
Sub Macro1()
On Error Resume Next
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim GTfeat As SldWorks.GeneralTableFeature
Dim TA As SldWorks.TableAnnotation
Dim sMgr As SldWorks.SelectionMgr
Dim longwarnings As Long
Dim boolstatus As Boolean
Dim i, j As Long
Dim partTitle As String
Dim nbrTableAnnotations As Long
Dim vTableAnnotations As Variant
Dim myTable As Object
Set swApp = CreateObject("SldWorks.Application")
Set swModel = swApp.OpenDoc6("Q:\Temp\311RSC-1.SLDDRW", 1, 0, "default", 0, longwarnings)
Set swModel = swApp.ActiveDoc
Set sMgr = swModel.SelectionManager
partTitle = swModel.GetTitle
swModel.ClearSelection2 (True)
'Select the table
boolstatus = swModel.Extension.SelectByID2("General Table1", "GENERALTABLEFEAT", 0, 0, 0, False, 0, Nothing, 0)
Set GTfeat = sMgr.GetSelectedObject6(1, 0)
nbrTableAnnotations = GTfeat.GetTableAnnotationCount
vTableAnnotations = GTfeat.GetTableAnnotations
Set TA = vTableAnnotations(i)
'Iterate through the table and load the data to the worksheet
For i = 0 To TA.RowCount - 1
For j = 0 To TA.ColumnCount - 1
'MsgBox TA.DisplayedText(i, j)
cells(i + 2, j + 1).Value = TA.DisplayedText(i, j)
Next
Next
i = 1
swApp.CloseDoc partTitle
'swApp.ExitApp
Set swApp = Nothing
Set swModel = Nothing
Set sMgr = Nothing
Range("A1").Select
MsgBox "Finished"
End Sub