+ Reply to Thread
Results 1 to 6 of 6

how to expose all of the userforms that are named UserForm#

  1. #1
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    how to expose all of the userforms that are named UserForm#

    i was using a routine by a member of this forum to count all of the userforms (any name)

    now what i need is a routine that counts all of the userforms named UserForm#.

    I have googled this but came up empty.

    Can someone help me?

  2. #2
    Forum Expert ByteMarks's Avatar
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    3,280

    Re: how to expose all of the userforms that are named UserForm#

    Loaded Userforms would be:
    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: how to expose all of the userforms that are named UserForm#

    thanks @bytemarks but it doesn't work. i put a debug.print at the function to tell me whats the number and it just comes in as a "1". but if i run your test (usage) then it reports as "0"

    thoughts?

    btw,i put the public function in a module at the top where declarations go. is that the problem?
    Last edited by dmcgov; 03-08-2019 at 01:59 PM. Reason: where do public functions go

  4. #4
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: how to expose all of the userforms that are named UserForm#

    ok, i see where the error is. to run your function, i first have to load all the userforms listed in the project window. that is not what i am looking for. i just want a # of userforms that are not loaded (named UserForm*), can that be done?

  5. #5
    Forum Expert ByteMarks's Avatar
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    3,280

    Re: how to expose all of the userforms that are named UserForm#

    It can, but you'll need to tick "Trust access to the VBA project object model" in Trust Center > Macro Settings.

    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: how to expose all of the userforms that are named UserForm#

    thanks @ByteMarks, that did the trick. and yes i had already done the trust access (needed from another macro).

+ 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. Userform Login on userform and disabling/enabling userforms controls
    By waimea in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-23-2019, 10:37 AM
  2. [SOLVED] How to create a window inside a userform to expose spreadsheet behind to view a chart
    By Farnsbarnes in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-16-2015, 11:18 AM
  3. Passing variable from userform to sub (used by multiple userforms)
    By vamosj in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-17-2015, 04:11 PM
  4. I need help coding a userform. I'm new to userforms
    By lcjohnson in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-10-2015, 02:09 AM
  5. Userforms - Passing a varible to edit in 2nd userform
    By rck3 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-27-2014, 11:07 AM
  6. [SOLVED] Password userform talk to other userforms
    By amotto11 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-21-2013, 12:12 PM
  7. [SOLVED] Copy Data loaded via Userform to a worksheet named in 1 field of the Userform
    By audax48 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-15-2012, 01:44 PM

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