+ Reply to Thread
Results 1 to 3 of 3

Does an object have to be visible for a module to work?

  1. #1
    Forum Contributor
    Join Date
    06-24-2013
    Location
    New Zealand
    MS-Off Ver
    Excel 2016
    Posts
    124

    Does an object have to be visible for a module to work?

    I have the following code which is stored in a module, that when called, it runs for a userform


    Please Login or Register  to view this content.

    Basically is does this:
    Please Login or Register  to view this content.
    However the row may change from time to time so my first code is used to preempt that.

    This code used to work, however it now throws an error when the PGE_SELECTOR visibility is set to false on the userform

    The error is
    Run-time error '13': Type mismatch


    Any ideas why it only appears to work when the PGE_SELECTOR (this is a just a label) is set to TRUE visibility?

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Does an object have to be visible for a module to work?

    What is the actual label caption when it's not visible and it errors?

    If it's set to a null-string or a non-numeric character, then that would generate a Type mismatch error.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Contributor
    Join Date
    06-24-2013
    Location
    New Zealand
    MS-Off Ver
    Excel 2016
    Posts
    124

    Re: Does an object have to be visible for a module to work?

    Found the issues was due to calling a blank sheet for another sub,
    Have fixed by adding a Sheet activate code just before this one.

+ 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. Module vs Object
    By silver.sagi in forum Excel - New Users/Basics
    Replies: 10
    Last Post: 08-07-2020, 01:04 AM
  2. Replies: 7
    Last Post: 06-16-2016, 08:54 AM
  3. [SOLVED] Module object error
    By lazyserv in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-31-2015, 11:28 AM
  4. [SOLVED] Member already exists in an object module form which this object module derives error
    By Sc0tt1e in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-01-2014, 03:14 AM
  5. Table Object after filtering - Count visible rows & First visible row
    By limalf in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-13-2013, 07:29 PM
  6. Replies: 3
    Last Post: 10-25-2011, 02:12 PM
  7. VBA Code not visible in module
    By ArviL in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-25-2011, 04:03 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