PDM Workgroup Macro Checkin Help Needed

I'm working on a macro to generate parts, drawings, and tif files from an Excel sheet.  It's redy for user testing except I would like to add checking the files into the PDM Workgroup vault.

Now this is where my problem come in.

I've read the few other threads here, Jarry Winter's 2007 Paper and any help I could find.

The code doesn't sound to difficult but I can't seem to get it to work.

I get a Run-time error document write permission was denied. (102)

The login works.  I've changed it up and got connection errors.  I've made new user test accounts and test projects.  There's no reason I can think of for this error.

I've used varaibles and I've put strings in quotes.  I've tried just about every combination of arguments  I could come up with.

I can check a document out and saem it to disk using macro code.

We do not have lifecycle enabled in our vault.  I turned it on for a couple of attempts but that didn't change anything so I turned it off.

We also use a custom revision scheme.  Does that make any difference?

Does the project use the "project" or "project name" property?

Does anyone have any ideas?

Sub main()

Dim connection As PDMWConnection
Dim Number As String
Dim Description As String
Dim note As String
Dim i_revOption As PDMWRevisionOptionType
Dim Revision As String
Dim lifecycle As String
Dim RetainOwnership As Boolean
Dim References As Object
Dim value As PDMWDocument

'Set swApp = Application.SldWorks

    Set connection = CreateObject("PDMWorks.PDMWConnection")
    connection.Login "strohtm", "x", "server01"
    FileName = "c:\\test\\TOM-1244.SLDPRT"
    project = "test"
    Number = "TOM-1244"
    Description = "Test Part"
    note = "test note"
    i_revOption = Default
    Revision = "-+"
    lifecycle = ""
    RetainOwnership = False
    connection.Refresh

    'Set References = Nothing           ->> Not need to set nothing because it is set Nothing by default
 
    'connection.checkin(filename, project, Number, Description, note, i_revOption, Revision, lifecycle, RetainOwnership, Empty)
    'value = connection.CheckIn(FileName,                                 project, Number,        Description,               Notes,                                     i_revOption,               Revision, lifecycle, RetainOwnership, "")
   value = connection.CheckIn("c:\\test\\TOM-1244.SLDPRT", "Test", "tom-1244", "Sample File", "Checkin with macro", PDMWRevisionOptionType.Default, "-", Other, True, Nothing)
    connection.Logout

End Sub

SolidworksApi macros