+ Reply to Thread
Results 1 to 2 of 2

Function Referencing An External Class When The Class Is Not Referenced

  1. #1
    Forum Contributor
    Join Date
    02-09-2009
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    380

    Function Referencing An External Class When The Class Is Not Referenced

    Sorry for the poor title. I'm trying to build a function that will copy dictionaries into another dictionary and then pass the new copied dictionary back to the original subroutine. There are some wasted duplication of arrays, dictionaries and collections; because I am teaching myself how to reference them. I also don't want to worry about properties in classes at the moment as they'll all be getting written to other dictionaries.

    I haven't attempted to pass the copied dictionary back to the original subroutine yet. That'll be a problem for another day .

    I'm having problems on Line 36 (coloured green); where I get a Run-Time error '451'; property let procedure not defined and property get procedure did not return an object.
    I know the problem is that I'm trying to reference a field of a class in a dictionary and it's trying to check the class to get a reference what the actual field is and that's where it's encountering problems.
    I imagine the solution is to put a reference to the class in there, however I'm trying to make this as versatile as possible in the future (and learn exactly how to reference dictionaries, collections, arrays etc...).

    What would be the best way to do this guys? I've read every tutorial out there and I know it seems easy when you know how but you read a tutorial many times and think you have it all sussed, then you try it and fall at the first hurdle .

    Please Login or Register  to view this content.

    1.jpg
    And in the class module Class1:
    Please Login or Register  to view this content.

    One needs to reference the Microsoft Scripting Runtime in order to run the application.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    02-09-2009
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    380

    Re: Function Referencing An External Class When The Class Is Not Referenced

    Sorry guys, the problem was I'm using a key I created myself which begins at 1. So the problem was in the function starting the loop at 0.

    Replace with 1 and it's all good.

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Class Module to design a class based on an autoshape (arrow)
    By BluesEnd in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-18-2017, 07:23 AM
  2. “= 1st class’ lower class limit + class width"
    By CheeseFace in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2016, 08:21 PM
  3. [SOLVED] Class method with class properties as arguments
    By amphinomos in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-25-2016, 11:44 AM
  4. Excel VBA - set Class properties from within the class
    By TheRobsterUK in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-14-2015, 09:41 AM
  5. [SOLVED] Class Newbie question #2 - Check if Class already loaded/set?
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-16-2014, 06:59 PM
  6. class foactory cannt supply requested class
    By rakeshkaduskar in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-26-2012, 02:00 PM
  7. [SOLVED] ComboBox class .AddItem filled in class module
    By Jacques Grobler in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-03-2012, 05:48 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1