Solidworks API

I am trying to extract the bounding box size for an assembly.  I have code that works well for a part.   This code is failing for the assembly   

 Dim assemblyDoc As AssemblyDoc = CType(Modeldoc, AssemblyDoc)
Modeldoc.ForceRebuild3(True)
' Handling for Assembly document type

Dim minPt(2) As Double ' X, Y, Z minimum point
Dim maxPt(2) As Double ' X, Y, Z maximum point

' Get the bounding box of the assembly
assemblyDoc.GetAssemblyBox(minPt, maxPt)
Debug.Print("minPt- " & minPt.ToString)
Debug.Print("maxPt- " & maxPt.ToString)