AronGahagan / cpt-dev

Code repository for the ClearPlan Toolbar
https://www.ClearPlanConsulting.com
3 stars 1 forks source link

cptStatusSheetImport - handle case when no updates are made #346

Closed AronGahagan closed 11 months ago

AronGahagan commented 11 months ago

Problem:

If there are no updates made, the length of string strUIDList is zero, the following code fails:

  'get the string of UIDs updated
  For Each vKey In oDict.Keys
    strUIDList = strUIDList & vKey & ","
  Next vKey
  strUIDList = Left(strUIDList, Len(strUIDList) - 1)  '<<< error

Solution:

  'get the string of UIDs updated
  If oDict.Count > 0 Then
    For Each vKey In oDict.Keys
      strUIDList = strUIDList & vKey & ","
    Next vKey
    strUIDList = Left(strUIDList, Len(strUIDList) - 1)
  End If

Todo: