+ Reply to Thread
Results 1 to 4 of 4

Accessing values in a class defined in another module

  1. #1
    Registered User
    Join Date
    12-14-2018
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    26

    Accessing values in a class defined in another module

    I have a main module (contains only one subroutine named main) and 4 other modules that do some operations on selections. One of these modules has a sub named surface, which gets properties of a selected surface and passes them into a class named sParameters. For example, sParameters.surfacetype = "cylinder", sParameters.axis="x". None of these values are are written into the sParameters class unless I have sParameters decalred as surfParams(my custom class) and unless I have Set sParameters = New surfParams within this subroutine. When I have these lines of code, subroutines in my surface module can't see these values and other modules can't see these values. I've tried to declare Public sParameters as surfParams before my main subroutine in my main module but I still don't see any values. I can't really post code as this code works with an external program. If need be, I can write some pseudo code which describes the process.

    Edit: I've included three txt files, one is the main subroutine and the other is the module that is assigning values into the custom class and the third is the class module.
    Attached Files Attached Files
    Last edited by roldy; 08-16-2019 at 09:12 AM.

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Accessing values in a class defined in another module

    Even if your code interacts with an extrernal program and won’t run without it, we still need to see it.

    Unfortunately we’d be taking shots in the dark without it.

    Happy to take a look with some code

  3. #3
    Registered User
    Join Date
    12-14-2018
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    26

    Re: Accessing values in a class defined in another module

    I've edited the post and included some code as attachments.

  4. #4
    Registered User
    Join Date
    12-14-2018
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    26

    Re: Accessing values in a class defined in another module

    No such luck?

+ 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. [SOLVED] Set textbox class module to look for null values on text box controls
    By buhwheet in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-10-2015, 01:04 PM
  2. Replies: 4
    Last Post: 01-30-2015, 03:01 PM
  3. [SOLVED] Accessing array in a class module
    By chipnputt in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-09-2014, 11:09 PM
  4. Initialising variables values in a class module
    By Andrew-R in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-24-2011, 12:38 PM
  5. Replies: 1
    Last Post: 08-30-2011, 02:23 AM
  6. Accessing Global Variables defined in ThisWorkbook Module
    By smz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-02-2010, 08:26 PM
  7. User-defined type collection in class module
    By Rob in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-31-2006, 01:10 PM

Tags for this Thread

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