Cannot find project or library -- error message

mcfranczyk

Active Member
Joined
Aug 19, 2005
Messages
304
I am getting the following error message when I try to run my macro.

Cannot find project or library

It seems excel cannot find "Format"

It also can't find "Date" and other normal references. What could have happened. It worked last night!

Code:
 For Mnth = 1 To 12
        UserForm1.lboxMnth.AddItem Format(MonthName(Mnth), "mmmm")
    Next Mnth


EDIT:

Just looked in the reference library and found this...

MISSING:Microsoft Calendar Control 10.0

How can this be fixed??
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Maybe...


Establish a reference to Microsoft Calendar Control 10.0. To do that, press Alt+F11 to go to the Visual Basic Editor. From the menu in the VBE, click Tools > References, then select "Microsoft Calendar Control 10.0 (the "10.0" would be "11.0" in version 2003). Click OK. Press Alt+Q to return to the worksheet and try the code again.
 
Upvote 0
Tom Urtis said:
Maybe...


Establish a reference to Microsoft Calendar Control 10.0. To do that, press Alt+F11 to go to the Visual Basic Editor. From the menu in the VBE, click Tools > References, then select "Microsoft Calendar Control 10.0 (the "10.0" would be "11.0" in version 2003). Click OK. Press Alt+Q to return to the worksheet and try the code again.

That worked, thanks.

What could have caused the error to occur?
 
Upvote 0
Same workbook on different computer where the ref was not set, or being used on a different version (2003 then 2002 when 11.0 is not recognized), or maybe a few other ways but those two are quite common.
 
Upvote 0
Tom Urtis said:
Same workbook on different computer where the ref was not set, or being used on a different version (2003 then 2002 when 11.0 is not recognized), or maybe a few other ways but those two are quite common.

Tom, if i'm going to be distributing an add-in to users who, without exaggeration, are on all 5 continents, how can I safeguard against these errors in the future? Fortunately, i am developing the add-in using many computers, so these issues should come up.
 
Upvote 0
Yukk. If this were a program like Outlook or Word you could always use late binding. With controls like this, frankly I do not know if late binding is possible, maybe it is, I just never use that control and cannot test for it. You could research on Google for keywords
excel programmatically reference library
for code on how to do that. I'd defer that question to others who have experience doing that.

The irony is, I program this stuff for international clients of my company; that's what I do. With cases like these controls and their references, I don't run into trouble with them because I develop my own userforms with customized controls that serve the same purpose and that's how I get around it. I know that does not help you immediately, just a suggestion that if you get stuck, you can mimic the look and functionality of the control to bypass the version rejection with "everyday controls" that don't require their own libraries. It takes more work but when it's done it's done.

Good luck, sorry I could not offer something more constructive than that.
 
Upvote 0
Tom Urtis said:
Yukk. If this were a program like Outlook or Word you could always use late binding. With controls like this, frankly I do not know if late binding is possible, maybe it is, I just never use that control and cannot test for it. You could research on Google for keywords
excel programmatically reference library
for code on how to do that. I'd defer that question to others who have experience doing that.

The irony is, I program this stuff for international clients of my company; that's what I do. With cases like these controls and their references, I don't run into trouble with them because I develop my own userforms with customized controls that serve the same purpose and that's how I get around it. I know that does not help you immediately, just a suggestion that if you get stuck, you can mimic the look and functionality of the control to bypass the version rejection with "everyday controls" that don't require their own libraries. It takes more work but when it's done it's done.

Good luck, sorry I could not offer something more constructive than that.

Fortunately, the calendar control is a faded idea from the past -- odd that the reference stayed. I replaced it with a date / time picker.

Are there some controls that are more likely to run into issues like this?
 
Upvote 0
mcfranczyk said:
Are there some controls that are more likely to run into issues like this?
Yes, there is. As Tom stated, and my general practices - for the same reasons, I tend to use common controls found native to Excel, that way I don't get caught with my shorts down when somebody else hasn't done a full install of Excel.

With the DateTime picker (DTpicker) control, you'll need an OCX file only found on a full install of Excel - which is not found with a Standard Install that (I've found) most people to have. The file is MSCOMCT2.OCX, Microsoft Windows Common Controls, which allows MSCOMCT2.OCXAnimation, UpDown, MonthView, DTPicker, FlatScrollbar.

A past post at this board describes how to install an ocx file to another computer, to gain this functionality. Thread here: http://www.mrexcel.com/archive2/49900/57962.htm .

From Microsoft: The DateTimePicker control is part of a group of ActiveX controls that are found in the MSCOMCT2.OCX file. To use the DateTimePicker control in your application, you must add the MSCOMCT2.OCX file to the project. When distributing your application, install the MSCOMCT2.OCX file in the user's Microsoft Windows System or System32 directory. For more information on how to add an ActiveX control to a project, see "Adding Controls to a Project" in the Programmer's Guide.

Additional MS support info: HERE and HERE.

I will generally go for a userform with 3 comboboxes, one for the month, the day and year. I will then use that because it has some distinct advantages. 1) It is native to Excel and easily transportable and installed in an add-in, 2) no external controls or references are needed and 3) they're easily troubleshooted.


HTH
 
Upvote 0
firefytr said:
mcfranczyk said:
Are there some controls that are more likely to run into issues like this?
Yes, there is. As Tom stated, and my general practices - for the same reasons, I tend to use common controls found native to Excel, that way I don't get caught with my shorts down when somebody else hasn't done a full install of Excel.

With the DateTime picker (DTpicker) control, you'll need an OCX file only found on a full install of Excel - which is not found with a Standard Install that (I've found) most people to have. The file is MSCOMCT2.OCX, Microsoft Windows Common Controls, which allows MSCOMCT2.OCXAnimation, UpDown, MonthView, DTPicker, FlatScrollbar.

A past post at this board describes how to install an ocx file to another computer, to gain this functionality. Thread here: http://www.mrexcel.com/archive2/49900/57962.htm .

From Microsoft: The DateTimePicker control is part of a group of ActiveX controls that are found in the MSCOMCT2.OCX file. To use the DateTimePicker control in your application, you must add the MSCOMCT2.OCX file to the project. When distributing your application, install the MSCOMCT2.OCX file in the user's Microsoft Windows System or System32 directory. For more information on how to add an ActiveX control to a project, see "Adding Controls to a Project" in the Programmer's Guide.

Additional MS support info: HERE and HERE.

I will generally go for a userform with 3 comboboxes, one for the month, the day and year. I will then use that because it has some distinct advantages. 1) It is native to Excel and easily transportable and installed in an add-in, 2) no external controls or references are needed and 3) they're easily troubleshooted.


HTH

Hmm. Probably going to have to send out a beta version to the userbase to see what is supported. I'm inclined to believe that the installations of excel on every users computer will be a complete installation, if only because, in a firm with hundred of thousands of employees, I couldn't imagine IT having done any less. However, I guess I'll have to be prepared to scale down the controls, just in case.
 
Upvote 0
Uh, sorry to burst your bubble, but I'd put money on the fact that IT departments rarely do full installs. They do what's quick and easy and gets people up and running with minimal downtime. The chances of people needing a complete install are very slim - welcome to the exception to the rule.

I have a workbook that I made for somebody for this exact reason today. Kinda funny actually. And for this EXACT reason. Truly ironic, but if only for myself.

Anyway, if you'd like I can email it to you tomorrow. Just pm me if you'd like me to send it. It's the only thing the workbook has on it and the code is commented fairly nice (imho). Or I can post to the board if you'd like.

I highly recommend you don't use anything fancy, such as the DTPicker, in lieu of you sending this to 5 continents. I would feel horrible for you having to do so much extra work and troubleshooting.
 
Upvote 0

Forum statistics

Threads
1,215,020
Messages
6,122,709
Members
449,093
Latest member
Mnur

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top