# Solved: Missing Reference in Visual Basic



## Unusual (Jan 22, 2009)

Hi 

PLease can someone urgently help!

I wrote a programme using VBA for Word and included a Microsoft Date Picker (version 6).

Now when I sent the programme to my boss it didnt work  and I managed to trace the error to the fact that his reference to Windows Microsoft Common Controls 2 6.0 (SP6) is missing. (I am assuming that the date picker is the problem because it wont display on his pc)

I dont know much about references so please can someone advise how we can fix the problem. Is it as simple as me sending him the relevant OCX file stored in the systems 32 folder on my PC??

Thanks a mil


----------



## OBP (Mar 8, 2005)

He may already have the Reference for it so he needs to check first.
He needs to press Alt + F11 to go in to the VBA Editor, on the Editor's Main Menu>Tools>References, any missing References will say missing on the list.
He can use the Drop down list to see if he has the Windows Microsoft Common Controls 2 6.0 (SP6) or maybe a different Version number (i.e. not 6.0).
If he hasn't got it you can browse to it in your References and then copy it and send it to him.
Or he can probably download it if it is a .dll file.


----------



## Unusual (Jan 22, 2009)

Thanks OBP.

In the VBA editor it does say that this reference is missing.

When you say that I can browse to the reference and copy it and send to him do you mean that I should go to the file stored in systems 32 folder on my PC (ie the address of this particular reference) and then copy that file and send it to him? The file is a .OCX file.


----------



## OBP (Mar 8, 2005)

If he hasn't got it that would best, does he need the Actual Program as well?


----------



## Unusual (Jan 22, 2009)

When you say the actual programme, do you mean the porgramme I wrote? 

So the fact that the OCX file is on his pc (in the right place) is enough to ensure that he will be able to reference the Date picker and it will no longer show "Missing"? Does he first need to reboot or something along those lines?

Thnx a mil


----------



## OBP (Mar 8, 2005)

The Actual program is the Date picker.
He should be able to use Access straight away.


----------



## Zack Barresse (Jul 25, 2004)

Are we talking Access or Word? I'm cornfused..

Is there any way of not using that control? It's always easier if you develop a project without using external references like this. As you can see, sometimes it's problematic. If you're just wanting a date picker, generally what I'll do is create a small user form with comboboxes for the month/day/year. Conversely you can uncheck the MISSING reference, click OK, then go back to the References dialog box and select the correct reference, then click OK. Save the document. All should be well at that point.

HTH


----------



## Unusual (Jan 22, 2009)

My question was actually relating to Word.

As you suggested Zack, it may be easier to just avoid the date picker totally.

But when you said "go back to the References dialog box and select the correct reference, then click OK", I didnt quite understand what you meant by the correct reference since the correct reference is missing. Am I missing something myself 

I am going to be away for a couple of days so may only respond to your response then, so please dont think that I have given up on this!

Thanks for everyones help!


----------



## Zack Barresse (Jul 25, 2004)

Uncheck the MISSING, click Ok. Go _back in_ to the references and search for the one that you want (i.e. Date Picker). Early binding isn't fun because of situations like this. If you do not see it in the list after you've cleared the MISSING reference, that's when you copy the ocx file to the other computer.


----------



## Unusual (Jan 22, 2009)

Hey Zack. Sorry for the delay! Been out of things a bit over the last few weeks.

Thanks a lot for your help. Everything is working fine now!


----------

