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.
Any ideas would be most welcomed!!! Thanks in advance for your help!!!
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!!!