Results 1 to 5 of 5

Thread: Solved: Enable additional controls by vba code

  1. #1
    VBAX Regular
    Joined
    Feb 2007
    Posts
    68
    Location

    Wink Solved: Enable additional controls by vba code

    Hi,
    I have a question:
    I have a user form on my workbook and I have put a pdf reader control and a web browser control on the user from ,then I saved that workbook and when I open It on another computer , and run it then I got an error called ?Compile Error? .

    I know why the error occurs because (According to me) you have to select those controls manually form the additional controls window (on that computer on which you want to run that file ) then that workbook will work properly. So is it possible that a code automatically selects those controls so my workbook will work properly automatically? I want such a code.
    Anybody have?
    I have attached a picture of this operation. It will help you.




    Regards,
    Dan

  2. #2
    VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,321
    Location
    You probably need to set a referenct to it in the vbe. go to tool reference and see if it shows any as missing. Could you attach the workbook here?
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  3. #3
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,476
    Location
    Search in the KB for Reference by Ken Puls. There's a couple of items there that may assist.
    Adding references
    Determining references
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  4. #4
    VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,321
    Location
    For dealing with the missing references as Malcolm points out. These are 3 of Ken's kb entries dealing with the problem:
    http://vbaexpress.com/kb/getarticle.php?kb_id=267
    http://vbaexpress.com/kb/getarticle.php?kb_id=272
    http://vbaexpress.com/kb/getarticle.php?kb_id=278
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  5. #5
    VBAX Regular
    Joined
    Feb 2007
    Posts
    68
    Location
    Hi Everyone ,
    I got the right solution from your reply, I found it in kb entries
    Thanks,
    Dan

Posting Permissions

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