Missing Calendar Reference in excel 2016 and automatically removing it or adding new ones

Son

Active Member
Joined
Mar 19, 2010
Messages
284
Hi, I have a workbook with a VBA project that is password protected. I developed the original wb in excel 2003, but now I've managed to make it work in excel 2016.
The wb is sent to the users who should open it and update it monthly.

The problem is that when the users will open it in excel 2016 for the first time they will get a compile error message, since the Calendar reference will be missing.
The compile error is because the date and time functions are not recognised with the missing calendar reference.

But the users cannot be trusted to unprotect the vba project by themselves and remove the missing calendar reference. Perhaps they could do it only once, with a pass 123 for example, but then they would not be able to uprotect it again.

I have put code on ThisWB Open, so it does various checks and runs various macros before opening.
So, is there a way for me to help the users remove the missing calendar reference?

Another thing I wanted to ask is if I can set references by code.
I have already used the following macro, so am wondering if there is a way to know how each reference is coded in excel.
VBA Code:
Sub RefToLibrary()
    ' create a reference to the VBA Extensibility library.
    On Error Resume Next            ' in case the reference already exits
    ThisWorkbook.VBProject.References _
                  .AddFromGuid "{0002E157-0000-0000-C000-000000000046}", 5, 0
End Sub

Any ideas would be most welcomed!!! Thanks in advance for your help!!!
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

mole999

Moderator
Joined
Oct 23, 2004
Messages
10,524
Office Version
  1. 2019
  2. 2016
  3. 2013
Platform
  1. Windows
if the end users aren't trusted, do they have macros enabled ?
 

Son

Active Member
Joined
Mar 19, 2010
Messages
284
The end users are not skilled enough to unprotect the vba project and uncheck the missing reference. And of course the vba project is protected by me, in case someone else tries to alter the code because he thinks there is a mistake or something else.

Everything they do they do it by pressing various buttons which are assigned to macros. Also, all sheets are protected.
 

Watch MrExcel Video

Forum statistics

Threads
1,129,931
Messages
5,639,064
Members
417,067
Latest member
rohitbabshet

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
Top