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
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 :
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 ?