+ Reply to Thread
Results 1 to 7 of 7

Removing Userforms

  1. #1
    Registered User
    Join Date
    06-23-2008
    Posts
    6

    Removing Userforms

    Hi

    Is it possible to remove userforms using VBA, I have tried

    Please Login or Register  to view this content.
    and

    Please Login or Register  to view this content.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,437
    Do you mean you want to remove the useform and associated code from a vba project using vba code?

    If so you will need to access the userform via the VBE object model.

    Why do you need to do this?
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    06-23-2008
    Posts
    6
    Hi

    I have a form made up of a series of user forms (30+) they are all coded and the different forms open according to the information you input (about 6 max). The Data is then transfered to an excel sheet and emailed to the admin team who do not need the user friendly format. I want to remove the userforms in order to make the file size smaller.

    cheers
    Si

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,437
    See Chip's page on programming the vbe
    http://www.cpearson.com/excel/vbe.aspx

  5. #5
    Registered User
    Join Date
    06-23-2008
    Posts
    6
    Thanks Andy, this link proved very useful. I have come across another hurdle I cannot get over.

    the VBA code is password protected, I know the password but I cannot get the VBE object to access it. I've tried "unprotect("password")" . is there a special way to unprotect it and reprotect it?

    cheers
    Si

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,437
    There is not way to uprotect the vbe via code, without resorting to sendkeys.

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Are you sure that you need 30+ UserForms?

    If you don't want them in the finished workbook then create them in your PERSONAL.xls or an addin.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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