MACRO TO NAME DRAWING VIEW

Hi,

I am fairly new to Solidworks and am trying to make a macro that will insert custom properties from a part into a view i insert onto a drawing sheet?

This is as far as i have got, but cant get the text to locate above the view without the attached error....any help would be appreciated....

Mark T

Sub main()

Set swApp = _
Application.SldWorks

Set Part = swApp.ActiveDoc
boolstatus = Part.ActivateView("")
boolstatus = Part.ActivateSheet("")
boolstatus = Part.ActivateView("")

Dim myNote As Object
Dim myAnnotation As Object
Dim myTextFormat As Object
Set myNote = Part.InsertNote("\$PRPVIEW:""Description"" - \$PRPVIEW:""Quantity"" OFF" + Chr(13) + Chr(10) + _
        "EX \$PRPVIEW:""Material""")
If Not myNote Is Nothing Then
   myNote.LockPosition = False
   myNote.Angle = 0
   boolstatus = myNote.SetBalloon(0, 0)
   Set myAnnotation = myNote.GetAnnotation()
   If Not myAnnotation Is Nothing Then
      longstatus = myAnnotation.SetLeader3(swLeaderStyle_e.swNO_LEADER, 0, True, False, False, False)
      boolstatus = myAnnotation.SetPosition("")
      boolstatus = myAnnotation.SetTextFormat(0, True, myTextFormat)
   End If
End If
Part.ClearSelection2 True
Part.WindowRedraw
boolstatus = Part.ActivateSheet("")
End Sub

SolidworksDrawings And Detailing