PDA

View Full Version : Solved: Enable additional controls by vba code



dansam
02-18-2007, 09:38 AM
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? :think:
I have attached a picture of this operation. It will help you.




Regards,
Dan

lucas
02-18-2007, 11:05 AM
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?

mdmackillop
02-18-2007, 11:26 AM
Search in the KB for Reference by Ken Puls. There's a couple of items there that may assist.
Adding references (http://vbaexpress.com/kb/getarticle.php?kb_id=267)
Determining references (http://vbaexpress.com/kb/getarticle.php?kb_id=278)

lucas
02-18-2007, 11:31 AM
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

dansam
02-19-2007, 12:27 AM
Hi Everyone ,
I got the right solution from your reply, I found it in kb entries
Thanks,
Dan