Vba ошибка 459

This article is about to how to fix the error 459 Object or class does not support the set of events. This error mostly occurs when we are using any object or variable that is not supported in class. There are other reasons also. This error may occur after applying one or more of several Microsoft security updates and if class does not support automation or does not support expected interface.

Firstly to understand we have to reproduce this error. For that we have to create the Form as shown in Fig 1.1.

Error 459 Object or class does not support the set of events. Fig-1.1

Fig:-1.1

After this we have to create two modules to test class A and class B. You will 459 «Object or Class does not support the set of elements» when assigning an object of class «A» to an object variable of class «B» in order to use an alternate interface as shown in Fig 1.2. The Visual Basic editors do not support events in inherited interfaces. WithEvents not supported the private User controls, because the type-info needed to raise the ObjectEvent not available at runtime. We cannot change the behavior of Visual editor. We can take it as limitation. For this particle example we can remove the WithEvents keyword from the objBC variable declaration. If we remove the Event declaration from the class A module, the editor compiler will also delete the WithEvents keyword on the variable declaration and code will executed without error.

Error 459 Object or class does not support the set of events. Fig-1.2

Fig:-1.2

VBA Code on Button clicks:

Private Sub Command0_Click()
Set CLASSA_obj = New Derived_Class
Set CLASSB_obj = CLASSA_obj

CLASSB_obj.PostAlert » test message»
Set CLASSB_obj = Nothing
Set CLASSA_obj = Nothing
End Sub
Sub DC_Alert(ByVal Msg As String)
MsgBox Msg
End Sub

VBA Code for CLASS A Module:

Option Compare Database
Event Alert(ByVal Msg As String)
Public Sub PostAlert(ByVal Msg As String)
End Sub

VBA Code for CLASS B Module:

Option Compare Database
Implements Base_Class
Event Alert(ByVal Msg As String)
Private Sub Base_Class_PostAlert(ByVal Msg As String)
RaiseEvent Alert(Msg)
End Sub


DISCLAIMER

It is advised that the information provided in the article should not be used for any kind formal or production programming purposes as content of the article may not be complete or well tested. ERP Makers will not be responsible for any kind of damage (monetary, time, personal or any other type) which may take place because of the usage of the content in the article.


i have created a simple class named Class1 and was testing if events are available for the objects or containers listed with WithEvents.

Class1

Class1:

Option Explicit

Public WithEvents Obj As OLEObject

Private Sub Obj_GotFocus()
    MsgBox "Got U"
End Sub

Private Sub Obj_LostFocus()
    MsgBox "Lost U"
End Sub

As i understand, OleObject is a container and such it has the above 2 events listed for it.

In Module1, this is a simple code which sets a single OleObject on Sheet1 of my workbook. For testing purpose, I have added 5 different ActiveX controls to see which one gets the events.

Module1:

Option Explicit

Dim clsObj As Class1

Sub doit()
    Set clsObj = New Class1
    Set clsObj.Obj = Sheet1.OLEObjects(1) ' Getting error 459 on this line
End Sub

The following line above results in an error:

Runtime Error ‘459’:
Object or class does not support the set of events

Note:

I can add a WithEvents to the object within this container e.g.
a Label1 and get it to work, but it gives a different set of
events and not the Got_Focus() & Lost_Focus() events. However, this is not what i want :

Class1:

MSForms.Label

Module1:

Module1

Questions:

  1. Can anyone explain why code does not allow to set the OleObject
    container object?
  2. What is the logic or purpose behind making these events available
    when they cannot be triggered at all?
  3. Why is the error message informing that these events are not
    available for any of the ActiveX controls added to Sheet1?
  4. Is there an alternative way to access the 2 OleObject container
    events?

asked Sep 13, 2019 at 6:54

sifar's user avatar

4

Load 7 more related questions

Show fewer related questions

Search code, repositories, users, issues, pull requests…

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

I’ve built a form in MS Access 2010 using multiple subforms in a tabbed control. Some of the subforms contain a TextField with an OnClick Macro opening a PopUp Form. When clicking the «OK»-Button, it calculates a value using someFn(), gets the current Tab from the Main Form and writes the value into the TextField in the corresponding SubForm.

This is the Code for the «OK»-Button in the PopUp Form:

Private Sub btn_ok_Click()
    Dim page As Integer
    page = Forms![00_data].Form.tabbed.Value
    Dim Val As Integer
    Val = someFn 'returns some Value between -1 and 100
    DoCmd.Close acForm, "10_my_popup_form", acSaveNo
    If Val >= 0 Then '0-100 are valid
        Select Case page
            Case 0
                Forms![00_main]![01_subform].Form.txt_field.Value = Val
            Case 3
                Forms![00_main]![04_subform].Form.txt_field.Value = Val 'Error 459
        End Select
    ElseIf Val = -1 Then '-1 is an error code, delete the Value
        Select Case page
            Case 0
                Forms![00_main]![01_subform].Form.txt_field.Value = Null
            Case 3
                Forms![00_main]![04_subform].Form.txt_field.Value = Null 'Error 459
        End Select
    End If
End Sub

The Sub runs perfectly fine if I click the txt_field on 01_subform (Tab 0) but why does it throw an Error on 04_subform (Tab 3)?

EDIT: I’ve found this microsoft article that mentions the error but none of the problem-solving approaches could fix the problem: http://support.microsoft.com/kb/2748410

As I’ve created 01_subform on 2014/01/26 and the update was installed on 2014/01/27 before I created 04_subform, this might really be the reason, but how do I fix it?

Icon Ex Номер ошибки: Ошибка 459
Название ошибки: Microsoft Access Error 459
Описание ошибки: Object or class does not support the set of events.
Разработчик: Microsoft Corporation
Программное обеспечение: Microsoft Access
Относится к: Windows XP, Vista, 7, 8, 10, 11

«Microsoft Access Error 459» Введение

«Microsoft Access Error 459» — это стандартная ошибка времени выполнения. Чтобы убедиться, что функциональность и операции работают в пригодном для использования состоянии, разработчики программного обеспечения, такие как Microsoft Corporation, выполняют отладку перед выпусками программного обеспечения. Поскольку разработчики программного обеспечения пытаются предотвратить это, некоторые незначительные ошибки, такие как ошибка 459, возможно, не были найдены на этом этапе.

Ошибка 459, рассматриваемая как «Object or class does not support the set of events.», может возникнуть пользователями Microsoft Access в результате нормального использования программы. Когда это происходит, конечные пользователи программного обеспечения могут сообщить Microsoft Corporation о существовании ошибки 459 ошибок. Затем Microsoft Corporation нужно будет исправить эти ошибки в главном исходном коде и предоставить модифицированную версию для загрузки. Поэтому, когда вы сталкиваетесь с запросом на обновление Microsoft Access, это обычно связано с тем, что это решение для исправления ошибки 459 и других ошибок.

Когда происходит ошибка 459?

Проблема с исходным кодом Microsoft Access приведет к этому «Microsoft Access Error 459», чаще всего на этапе запуска. Причины сбоев обработки можно отличить, классифицируя ошибки 459 следующим образом:.

Ошибка 459 Crash — это типичная ошибка 459 во время выполнения, которая полностью аварийно завершает работу компьютера. Эти ошибки обычно возникают, когда входы Microsoft Access не могут быть правильно обработаны, или они смущены тем, что должно быть выведено.

«Microsoft Access Error 459» Утечка памяти — Ошибка 459 утечка памяти происходит и предоставляет Microsoft Access в качестве виновника, перетаскивая производительность вашего ПК. Критическими проблемами, связанными с этим, могут быть отсутствие девыделения памяти или подключение к плохому коду, такому как бесконечные циклы.

Ошибка 459 Logic Error — логическая ошибка возникает, когда компьютер генерирует неправильный вывод, даже если пользователь предоставляет правильный ввод. Это происходит, когда исходный код Microsoft Corporation вызывает недостаток в обработке информации.

Microsoft Access Error 459 проблемы часто являются результатом отсутствия, удаления или случайного перемещения файла из исходного места установки Microsoft Access. Основной способ решить эти проблемы вручную — заменить файл Microsoft Corporation новой копией. Если ошибка Microsoft Access Error 459 возникла в результате его удаления по причине заражения вредоносным ПО, мы рекомендуем запустить сканирование реестра, чтобы очистить все недействительные ссылки на пути к файлам, созданные вредоносной программой.

Типичные ошибки Microsoft Access Error 459

Типичные ошибки Microsoft Access Error 459, возникающие в Microsoft Access для Windows:

  • «Ошибка приложения Microsoft Access Error 459.»
  • «Ошибка программного обеспечения Win32: Microsoft Access Error 459»
  • «Microsoft Access Error 459 должен быть закрыт. «
  • «Файл Microsoft Access Error 459 не найден.»
  • «Отсутствует файл Microsoft Access Error 459.»
  • «Ошибка запуска в приложении: Microsoft Access Error 459. «
  • «Файл Microsoft Access Error 459 не запущен.»
  • «Ошибка Microsoft Access Error 459. «
  • «Ошибка пути программного обеспечения: Microsoft Access Error 459. «

Ошибки Microsoft Access Error 459 EXE возникают во время установки Microsoft Access, при запуске приложений, связанных с Microsoft Access Error 459 (Microsoft Access), во время запуска или завершения работы или во время установки ОС Windows. Запись ошибок Microsoft Access Error 459 внутри Microsoft Access имеет решающее значение для обнаружения неисправностей электронной Windows и ретрансляции обратно в Microsoft Corporation для параметров ремонта.

Корень проблем Microsoft Access Error 459

Заражение вредоносными программами, недопустимые записи реестра Microsoft Access или отсутствующие или поврежденные файлы Microsoft Access Error 459 могут создать эти ошибки Microsoft Access Error 459.

В первую очередь, проблемы Microsoft Access Error 459 создаются:

  • Недопустимые разделы реестра Microsoft Access Error 459/повреждены.
  • Файл Microsoft Access Error 459 поврежден от вирусной инфекции.
  • Вредоносное удаление (или ошибка) Microsoft Access Error 459 другим приложением (не Microsoft Access).
  • Другая программа находится в конфликте с Microsoft Access и его общими файлами ссылок.
  • Поврежденная загрузка или неполная установка программного обеспечения Microsoft Access.

Продукт Solvusoft

Загрузка
WinThruster 2023 — Проверьте свой компьютер на наличие ошибок.

Совместима с Windows 2000, XP, Vista, 7, 8, 10 и 11

Установить необязательные продукты — WinThruster (Solvusoft) | Лицензия | Политика защиты личных сведений | Условия | Удаление

Понравилась статья? Поделить с друзьями:
  • Vba ошибка 440
  • Vba ошибка 424 object required как исправить
  • Vba как пропустить ошибку
  • Vba исключение ошибок
  • Vampire the masquerade bloodlines ошибка при установке