Macro crashes when using SetColumnType in 2008

I have a macro that updates our drawing and it uses thesetcolumntype command. On some of the drawings it shuts downSolidWorks and will give an "Object has disconnect from client"error. I can not catch the error with VBs error trapping. Is anyoneelse having this problem? It does not happen very often and Ibelieve it just happens on the older drawings.
A sample code is below. I couldn't get a zipped file to upload.

Thanks
Dan Miel
SW2008 as of last week

Option Explicit
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim boolstatus As Boolean
Dim SelMgr As Object
Dim theTableAnnotation As SldWorks.TableAnnotation
Dim SelObjType As Long
Dim TableAnnotationType As Long

Sub main()
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set SelMgr = swModel.SelectionManager
SelObjType = SelMgr.GetSelectedObjectType2(1)
If SelObjType <> 98 Then 'swSelANNOTATIONTABLES
MsgBox "You must select a BOM table in the drawing before runningthis example."
End
End If
Set theTableAnnotation = SelMgr.GetSelectedObject5(1)
TableAnnotationType = theTableAnnotation.Type
If TableAnnotationType <> 2 Then'swTableAnnotation_BillOfMaterials
MsgBox "Select a BOM table in the drawing before running thisexample."
End
End If

'boolstatus = theTableAnnotation.InsertColumn(4, 0, "New Column")'swTableItemInsertPosition_Last = 4
'boolstatus =theTableAnnotation.SetColumnType(theTableAnnotation.ColumnCount -1, 201) 'swBomTableColumnType_PartNumber = 201

Debug.Print "Type = " & theTableAnnotation.GetColumnType(0);
Debug.Print "Column Count = " & theTableAnnotation.ColumnCount
boolstatus = theTableAnnotation.SetColumnType(0,swBomTableColumnType_PartNumber)
boolstatus = theTableAnnotation.SetColumnTitle(2, "TITLE")

Exit Sub
ErrorHere:
MsgBox "It Crashed"
Resume Next
End Sub

SolidworksApi macros