Library not registered & ShapefileColorScheme

May 17, 2012 at 1:30 AM

Good morning

I have to update my old MapWingis project embedded into an Access Interface written in VBA. I need to have a color scheme for my point shapefile to show differents activities (activity 1=red, activity 2=green)....

I wrote this code in VBA with:

 Dim mwColScheme As MapWinGIS.ShapefileColorScheme
        Dim mwColBreak As MapWinGIS.ShapefileColorBreak
    
        'Initialize a new ShapefileColorScheme object (make sure to assign the layer handle it goes with)
        'mwColScheme = New MapWinGIS.ShapefileColorScheme
        Set mwColScheme = New MapWinGIS.ShapefileColorScheme
        mwColScheme.LayerHandle = PointLineLayer
        mwColScheme.FieldIndex = 5

        'Make a color ramp from red to blue for the states with area = 0 to 100000
        'mwColBreak = New MapWinGIS.ShapefileColorBreak
        Set mwColBreak = New MapWinGIS.ShapefileColorBreak
        mwColBreak.Caption = "Bank"
        mwColBreak.StartValue = "1"
        mwColBreak.EndValue = "1"
        mwColBreak.StartColor = RGB(255, 170, 42)
        mwColBreak.EndColor = RGB(255, 170, 42)
        mwColScheme.Add (mwColBreak)

But when i run it, i got an "automation error, library not registered" on

 mwColScheme.Add (mwColBreak)

The library is correctly registered, every works nicely for generating my shapefiles, displaying them but the code get stuck on that line.

I can not really update MapWinGis from my current version 4.7 to 4.8 since i am afraid my code could be broken and i will have to update all my clients PCs...

If i can not solve this code, is there another way of having a color class/scheme with MapWinGis in VBA?

Thanks for your help

Sylvain