Click here to Skip to main content
15,892,809 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have created a COM library dll that i want to use with Access 2015 running on a Windows 10 machine.

For this I have made a COM class that looks like this

VB
Imports System.Runtime.InteropServices
Imports System.Drawing
Imports System.IO


<Guid("752F9930-6E87-417D-8AD4-1240E9CA2E46")>
Public Interface imageProcessorInterface
    Function getInfo() As String
    Function getImage(itemId As String) As String

End Interface

<Guid("722676EC-BCFA-4478-B850-7B2B753E8E68")>
<ClassInterface(ClassInterfaceType.None)>
Public Class imageProcess
    Implements imageProcessorInterface

    Public Function info() As String Implements imageProcessorInterface.getInfo
        Return "Version 1.0 2015-12-23"
    End Function

    Public Function getImage(itemId As String) As String Implements imageProcessorInterface.getImage
        If My.Computer.Clipboard.ContainsImage = True Then
            Try
                Dim image As System.Drawing.Image = My.Computer.Clipboard.GetImage
                Dim bitmap As New Bitmap(image)
                bitmap.Save("C:\test\" & itemId & ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg)

            Catch ex As Exception
                Return "CM Error Message : " & ex.Message
            End Try
            Return "OK"
        Else
            Return "NOK"
        End If
    End Function

    Public Sub New()
        MyBase.New()
    End Sub

End Class


When I build this library with COM options all set, it shows up nicely in my reference box in Access. It even has intellisense working just fine.

However, on my labtop running Access 2016 on Windows 7 it works like a charm, while on my windows 10 machine it fails with an error :

Runtime Error 429 - ActiveX Component Can't Create Object

Can someone help we work this out, I only have one machine that runs on WX so I can't check if it's the machine or something with rights on this machine.

I run Access as an administrator, but that also did not work.

The library is called by VBA using :

VB
Dim newImageProcessor As New imageProcess
Debug.Print newImageProcessor.getInfo


But when you try to run it, the 429 shows up.

I have tried several fixes for problems with runtime error 429, but no luck yet, anyone have another suggestion ?
Posted
Updated 22-Dec-15 23:43pm
v2

1 solution

I have made it work, but had to reinstall Office 365. Don't know why at this time, but my library did not work with the 64bits version of Office.

I have now installed the 32bits version of Office and it works.

This having the .NET COM Libray set to target both x86 and x64 CPU's, but that didn't work either.

Now happy to at least have a working version, at some point I will have to look into why the 64bits version of Office does not work.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900