Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Calendar control problems.

kralskrals Posts: 57Member
Hi to all,
I wrote an application for a friend who has the need to submit new customers for his job.the Main form somewhere has a button who sais:"Date".
So when u press this button it shows a calendar control and you can just select month,day,year.When you press the button "ok" a label takes this information like this 24/4/2007.The code i have written in the window with the callendar is:

Form1.lblseldate.Caption = Calendar1.Day & "/" & Calendar1.Month & "/" & Calendar1.Year

Ok,so here is the problem now:
The application is running in my pc well,and calendar also..everything ok,but when i transfer the exe to my friend's pc ,when i open the calendar and press the button "ok" i get the following error message:

Runtime error -21.....Method Year of Object ICalendar failed.

I thought to use the msgbox command to see what do i get (msgbox Calendar1.Month ),and the resault is that it shows ALWAYS 16!!!

I even installed VB6 to my friend's computer and tried to run it from there,but still get ther same error.

I cant understand why is happening this.This application works fine on my pc.

Any suggestions?

Thanks.

Comments

  • dokken2dokken2 Posts: 532Member
    : Hi to all,
    : I wrote an application for a friend who has the need to submit new
    : customers for his job.the Main form somewhere has a button who
    : sais:"Date".
    : So when u press this button it shows a calendar control and you can
    : just select month,day,year.When you press the button "ok" a label
    : takes this information like this 24/4/2007.The code i have written
    : in the window with the callendar is:
    :
    : Form1.lblseldate.Caption = Calendar1.Day & "/" & Calendar1.Month &
    : "/" & Calendar1.Year
    :
    : Ok,so here is the problem now:
    : The application is running in my pc well,and calendar
    : also..everything ok,but when i transfer the exe to my friend's pc
    : ,when i open the calendar and press the button "ok" i get the
    : following error message:
    :
    : Runtime error -21.....Method Year of Object ICalendar failed.
    :
    : I thought to use the msgbox command to see what do i get (msgbox
    : Calendar1.Month ),and the resault is that it shows ALWAYS 16!!!
    :
    : I even installed VB6 to my friend's computer and tried to run it
    : from there,but still get ther same error.
    :
    : I cant understand why is happening this.This application works fine
    : on my pc.
    :
    : Any suggestions?
    :
    : Thanks.


    instead of copying the exe, did you build an install with the package/deploy wizard? that will put the controls and references on the target pc. [however, i recall having other problems with the calendar control in the past, after installing the program it would say the calendar didn't have a license]
  • BitByBit_ThorBitByBit_Thor Posts: 2,444Member
    :
    : instead of copying the exe, did you build an install with the
    : package/deploy wizard? that will put the controls and references on
    : the target pc. [however, i recall having other problems with the
    : calendar control in the past, after installing the program it would
    : say the calendar didn't have a license]

    That should work (the Calendar control is licensed?!)

    It sounds like a version differene of the control.
    The error suggests that the control DLL does exist, but just doesn't have the right version. It should be an older version installed on the target machine.

    Best Regards,
    Richard

    The way I see it... Well, it's all pretty blurry
  • dokken2dokken2 Posts: 532Member

    : That should work (the Calendar control is licensed?!)
    :
    : It sounds like a version differene of the control.
    : The error suggests that the control DLL does exist, but just doesn't
    : have the right version. It should be an older version installed on
    : the target machine.
    :

    the control shows its located in the MS-Office folder. don't recall the exact error message but it refused to work on some pc's
  • kralskrals Posts: 57Member
    so is there any solution for this error?
  • dokken2dokken2 Posts: 532Member
    : so is there any solution for this error?


    i don't remember finding a solution.

    you [italic]might [/italic] be able to unregister the calendar control, at command prompt type - Regsvr32 /u c:path_MSCAL.ocx

    copy the new calendar control file to target pc [rename the old one just in case] and register the newer version w/ Regsvr32 c:path_MSCAL.ocx

  • kralskrals Posts: 57Member
    OK!! i fixed it!
    I searched my PC for all files started with MSCAL.* I found about 10 files which i copied them (overwrite) to the appropriate folders to the other pc.
    i found these files in two different locations:a)system32 and b)Program filesmicrosoft officeoffice11

    So Calendar control works fine now.
Sign In or Register to comment.