Modules & VBA :: Class Does Not Support Automation
Jul 31, 2015
I get the message "The expression On Click you entered as the event property setting produced the following error: Class does not support Automation or does not support expected interface"
I receive the message on a PC running Windows 7 Professional using the Access 2013 Runtime. This pc does not have Access 2013 installed.On my pc, I do not get the error. I have Access 2013 installed and run Windows 7 Professional SP1. The "code" which gives the error is as follows and is invoked by clicking a button on a form
Code:
MsgBox "1"
Dim rst As ADODB.Recordset
MsgBox "2"
Set rst = New ADODB.Recordset
MsgBox "3"
[code]....
The error takes place after Msgbox "2" and before Msgbox "3".The strange thing is that I can run without a problem a sophisticated software package on the pc which gives the error, using Access 2013 Runtime. This package I converted from Access 2003.
I have this below which some people cant run and some people can. All are using 2010 runtime version. Apart from the one guy who can run the macro who has full 2010 version. I have 2010 runtime installed and i can also run the macro fine.
Private Sub Option12_Click() On Error GoTo Option12_Click_err Dim CntlPay As String Dim Lable As String CntlPay = "D"
I have wrote a database in access 2010 and the database works fine for me (I am the db admin with full control).I gave the database to a group in which most of them also have no issue with the file. They are able to use the database with no issues..One of those members gets an error message when completing the initial step in the database: (select a drop down item from a combo box)
Code: The expression After Update you entered as the event propoerty setting produced the following error: Object or class does not support the set of events
Something I cant seem to understand is why is this happoening on 5 machines but not on the 6th, they all have the same PC set up so there should be no error on one particular machine.
I and trying to link to Outlook 2007 using the "External Data/More/Outlook Folder option and keep getting the "Object Class does not Support the Set of Events" error message.
I can link to a DBF and Paradox file without any problems.
I am running Office 2007 Professional and Access 2007 and Windows 10.
I have also done the following:
1. Removed Office 365 2. Decompiled the Access VBA code and corrected any issues 3. Compacted/Repaired the database
I have attached a screen shot of the references that I have selected.
This is a new setup as I recently purchased a new PC and Windows environment. I still have the old PC running Windows XP with the same configuration and it also experiences exactly the same error message.
I have distributed my front end on the shared drive for users to copy to their desktops.
In one form I have a formula in the query that show's the word 'Gap' if any of the 15 questions on the form is equal to 'fail'. It runs on current when the user is in a record it shows the word 'Gap' at the top header part of the form.
When the user opens the form they get an error message pop up that says "The expression On Current you entered as the event property setting produced the following error: Object or class does not support the set of events."
Once they click 'ok' they are able to work in the form until they attempt to filter records by their name it pops up again.
I've tested on my end and no errors or issues come up.
Couple days ago our database was not opening, Access would open but show a blank workspace. Anyhow, we restored the database from Server and it worked on all 5 shared systems on company's network but this one computer. It is giving the error, "Object or class does not support the set of events."
I tried to copy new local folder but nothing. I checked the links and target folder it looks fine.
I tried to import the everything into new database but it said I don't have permission for that.
what's causing this issue and what can I do to fix it?
Populating the table in db3 with a subset of records from db2.
I've gotten as far as opening the db2 and copying the table structure. Can't figure out how to run the query using execute rather than docmd.openquery.
Code: Dim appAccess As Access.Application Set appAccess = New Access.Application appAccess .OpenCurrentDatabase "DbPathString" 'copy the table structure to dbQn, overwrites any previous with same name
I'm trying to add a value from access into a combo box on a web page. I can get the combo box to refresh, but not add in a value..The HTML for the combo box is
I have two class variables (both arrays) among about 10 other class variables, that are not returning any values but "" for the string or #12:00:00AM" for a date. Here are my class variables:
Code: 'UPSData Class Module Private p_LetterArray() As String Private p_date() As Date Private p_LetterArraySize As Integer
My Properties
Code: 'Properties Public Property Get LetterArray(index As Integer) As String LetterArray(index) = p_LetterArray(index) End Property Public Property Let LetterArray(index As Integer, NewValue As String)
[Code] ....
As I said, tLet and tDate result in "" and #12:00:00AM# respectively. When I step through the code, the values for tmp.LetterArray(0) is assigned "src" and tmp.UPSDate(0) stores "12/25/2013" correctly.
When I assign tLet and TDate, the same thing happens when stepping through the code. I'll use the LetterArray property to describe what happens:
Get LetterArray is called. p_LetterArray(0) does equal "src" Let LetterArray is called. NewValue is "src" and p_LetterArray is "src" when End Property is highlighted in the debugger Scope returns to Get LetterArray with End Property highlighted. In checking the values, LetterArray(0) = ""
Same steps happen with the same results ("12:00:00AM" vice "")
Any way to make objects to support adjusting continuous form controls making them unique in a sense to be able to change info like captions or whatever.
I've been working with collections for a while now tapping into event handlers such as the mouse inputs and or sizing of objects real time using collections but I can't seem to nail down any un-documented way to serialize controls on a continuos form.
I have tried when the new user creates the record adding another control to the collections class tying it to the id of the record but still this does not seem to be enough.
I do not know if there is a paint method or something of the sort I can override to get the desired results and most people without even trying will tell you this can't be done but how many have said that you can't move and resize objects in access but we are doing that now...
I'm using Access 2003. In "References" (Tools > References > Browse...), I've added in "Microsoft Windows Common Controls 6.0 (SP6)" (c:windowssystem32mscomctl.ocx).
I've then created/inserted an instance of the control "Microsoft ListView Control 6.0 (SP6)" on a Form ("MyForm") and given the listvew control the Name "MyListView".I wanted to decorate MyListView with some custom methods so I've created a new class module ("DecoratedListView") which contains a member field called "lvw".
I want 'lvw' to point/reference to MyListView, but I don't know what reference type to use in its declaration. Importantly, I also want to capture lvw's ColumnClick event.
I've tried:
Code: Public WithEvents lvw As Object Public WithEvents lvw As Control Public WithEvents lvw As MSComctlLib.ListView.2 Public WithEvents lvw As MSComctlLib.ListView Public WithEvents lvw As CustomControl
and none works when I
Code: set lvw = Forms!MyForm.MyListView
The first try (Object) doesn't even compile. I get the exception "Expected: identifier" The second try (Control) doesn't compile either. I get the exception "Object does not source automation events" The third try (MSComctlLib.ListView.2) doesn't compile and throws the exception "Expected: end of statement" The fourth try (MSComctlLib.ListView) compiles but fails at runtime with the exception "Type mismatch". Using TYPENAME() on the control returns "CustomControl". The fifth try (CustomControl) compiles but fails at runtime with the exception "Object or class does not support the set of events".
I can't believe I'm the first person to have tried to capture an ActiveX Control's events in a separate class.
Basically I have a class event that works for all controls on any userform.
Its all working fine but I can't add an event to trap the click or mouse move of the userform itself.
Basically so when the cursor moves away from a control the label clears.
User Form Code
Code: Option Compare Database Option Explicit 'Define a collection and initialise the commandbutton event class Private col As New Collection Private newCmd As New clsEvents
[Code] .....
And here is the class Module
Code: Option Compare Database Option Explicit 'catch the event of Commandbuttons Private WithEvents C0 As SubForm 'Private WithEvents C1 As CheckBox
I've been playing around with creating my own class in VBA but I'm having problems calling its methods. My class is pretty basic, its called cDentist and the properties are just Name, Address, DOB etc and one method AddDentist. AddDentist will add the details to a sql server table.
So I create an instance of the class in a module called Dentist. At the very top of the code i put..
Code: Option Compare Database Global Dentist As cDentist
I have a method then in module Dentist, where I initialise the instance of class cDentist and i populate it's properities...
Code: Sub RecordDentistDetails() Set Dentist = New cDentist Dentist.Name = Forms!frm_enterdetails!txtName
[Code].....
When I click 'Save' I get error, Method or data member not found. And '.AddDentist' is highlighted. I'm a little confused why it's not seeing AddDentist as a method of class cDentist.
I am trying to pass a boolean variable to a class module
Code: Set rps.ViewS = View
the code in the module that this in theory is calling reads as
Code:
Private ViewC As Boolean
Public Property Set ViewS(ByRef ViewA As Boolean) Set ViewC = ViewA End Property Public Property Get ViewS() As Boolean Set ViewS = ViewC End Property
However I am getting the error message
Quote:Definitions of property procedures for the same property are inconsistent, or property procedure has an optional parameter, a ParamArray, or an invalid Set final parameter.
I have just started to develop a database that will export data directly into a word template. I have used Word automation quite a lot but I'm new to trying to automate Word from Access.
It's going OK at the moment, I have got the db to open up the template, write data and then close. My objective is to add the data to multiple tables within word. So I have created several tables in my word template and then tried to select these tables and write to the them. Everything is thing for the first table but for any other table I get an error message saying that the member of the collection doesn't exit i.e. the table isn't there. I select the table using:
Code: objWord.selection.tables (2).select
I then used:
Code: objWord.selection.tables.count
To show how many tables were in the document and it doesn't matter how many there are, it always says there is 1 table.
why it can only see 1 table and what I can do to get around it?
I have programmed a letter using automation to Word VBA. The letter works like a mail merge so it might cycle thru several records when it runs. I've separated each letter in the document with a section break. I'm having a problem with the header. I've successfully added a header, but when it moves to the next record, it replaces the header in the entire document with the current record. I want each section to insert data from that record. How can I fix this? Below is a sample of my code (note: the linktoprevious doesn't seem to work either).
x = 1 'Create Header With ActiveDocument.Sections(x) .Headers(wdHeaderFooterPrimary).LinkToPrevious = False .PageSetup.DifferentFirstPageHeaderFooter = True
I haven't created classes in a while, and I don't see what is the problem
I'm modifying a function to get fractions from double. It worked well, but it returned a string.
I need it to be in parts, so I created this class
Code: Option Compare Database Public Entier As Integer Public nominateur As Integer Public denominateur As Integer Public Function getText() getText = Entier & " " & nominateur & "/" & denominateur End Function
I changed the function type and the assignation:
Code: Function GetFraction(ByVal Num As Double) As nombreEnFraction Set GetFraction = New nombreEnFraction If Num = 0# Then GetFraction = "None" Else Dim WholeNumber As Integer Dim DecimalNumber As Double
[Code] ....
For some reasons, when I get to the end of the function, I get a 91 error, like if it was nothing
But when I use a spy, I see values in the object until the end.
I have a parent form which has a class variable (class module instance) to store the form' status and more.... and when i add a new record to the subform it resets the class variable field' data. but this only happens on first transaction, but if i re-run the steps (re-set the variable field value) it's not happening again.
I am running Office 2010 but at one time also had Office 2013 installed on my Windows 7 64 bit OS PC. The first attachment (AccessProblem) shows the error message that I get when it hits the
Set olApp = CreateObject("Outlook.Application")
line. I get the automation error - library not registered error. The second attachment (Access2Problem) shows the references that I have.
I'm trying to subtotal data in an excel file but I am getting a subtotal method of Range class failed in the red text below. I have been trying to get this to work with no success.
Code:
Public Function SUMMARY() Dim xlApp As Object Set xlApp = CreateObject("Excel.Application") With xlApp Dim wb As Object
I am trying to format an excel spreadsheet through access, specifically trying to convert a column from text to dates (I receive the data in text format and need to translate it to dates).
Code: Dim excelApp As Object Set excelApp = CreateObject("Excel.Application") excelApp.screenupdating = False excelApp.Visible = False Set excelWB = excelApp.workbooks.Open("Z:DataBasicSMData.xlsx")
[Code] ....
I'm no longer getting an error, but it isn't actually modifying the spreadsheet...
I developed a finance tracker database for tracking project revenues and costs (forecast and actual amounts). I have a form where we enter a new Work Order in the DB. This Work Order form has a continous subform where we create all the billing periods needed for the life of the Work Order. Once the billing periods are created (opened) we can then add our revenue and cost forecasts for each period. We have a Billing Period lookup table that has our billing periods with their respective start and end dates (which usually begin around the last week of a month and end about 3 weeks into the next month).
For the purpose of this question, lets say we only enter the required WO_Number and WBS_Code (Composite key) and the Work Order Start_Date and End_Date. I want to click a button to runs some code to automatically create all the billing periods for which their start and end dates fall into the Work Order start and end dates.
For example, say a Work Order starts on 5/1/2013 and ends on 7/31/2013
The billing period dates in the Billing Periods lookup table are as follows: May-13 ---> 4/22/2013 - 5/19/2013 Jun-13 ---> 5/20/2013 - 6/23/2013 Jul-13 ---> 6/24/2013 - 7/21/2013 Aug-13 ---> 7/22/2013 - 8/18/2013
Then we would need the following billing periods created in the Work Order subform: May-13 Jun-13 Jul-13 Aug-13
I don't even know where to start on this. Is it possible to automate this process with the setup I have? If so, how would I structure the VBA code/logic to use the billing period lookup table and create entries in the subform for all the billing periods that fall into the duration of the Work Order.
The attached DB is a stripped down version with only the tables and forms needed for this problem.