+ Reply to Thread
Results 1 to 5 of 5

Calendar macro - debugging some old code

  1. #1
    Registered User
    Join Date
    11-02-2010
    Location
    OSEBX
    MS-Off Ver
    Excel 2007
    Posts
    8

    Calendar macro - debugging some old code

    Hi,

    Thank you for taking the time to try helping out with this problem. Having somewhat undeservedly gotten a reputation as someone who knows a lot about excel macros, IT recently wanted me to look into an old form for them.

    Having recently upgraded from 2003 to 2007 (not 2010 for some reason), the form stopped working as before. More specifically a date picker function that would let the user pick a date, and then treating the day, month and year separately in other subs. The code that stops working is the one that, according to my predecessors mark up "defines" the calendar:

    Please Login or Register  to view this content.
    My google fu only goes so far as to give me a lot of search results about *** and dating, so I'm trying my luck with the nice guys and girls here at the forum. Has Excel changed up how it interprets dates since 2003, or is there something else wrong with the code?

    In case it helps, I've put the full sub beneath this description, along with my predecessors comments. I'm unfortunately not allowed to upload the work book as a whole. Then again it's such a maze of confusing code, I think it's just as well. The main issue here is how excel works with calendars and calendar related objects.

    If you're still reading at this point you're a real trooper. If you can even come up with some helpfull suggestions as to how I get this code running again I'll give you a virtual hug (or handshake, if a hug seems to personal)

    Thanks in advance!

    /Black Monday

    Please Login or Register  to view this content.
    Last edited by Black Monday; 02-27-2011 at 07:26 PM. Reason: Solved

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Calendar macro - debugging some old code

    Hello Black Monday,

    The problem is mostly somewhere in the Class Module that holds the code for ExDate. This is a custom VBA class that was created to show and control the calendar. Can you post the code from that module?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    11-02-2010
    Location
    OSEBX
    MS-Off Ver
    Excel 2007
    Posts
    8

    Smile Re: Calendar macro - debugging some old code

    Thank you for the quick reply, Leith, and sorry for not getting back to you sooner. I've been looking through this workbook as fast as I managed.

    The fact that ExDate is a custom class is valuable information. I have scoured the literally more than thousand subroutines making up the different modules in this jungle of a workbook, but have found no other mention of ExDate. The code I posted in my previous post is the only code under the module called "calendar", and no other module seems related to defining the calendar. Can the problem simply be that the module containing the code for ExDate was in a different workbook, and that this has gone missing during the transition to Excel '07?

    The debug message I get is "Active X component can't create object", by the way, on the off chance that that gives you any more to work with.

    /Black Monday

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Calendar macro - debugging some old code

    Hello Black Monday,

    Sorry for the late response. My computer crashed and I had to reload my wireless driver after the Blue Screen of Death informed me of a "Serious network error has occurred".

    You are probably on the right track. If there are no Class modules in the project then it was probably contained in another workbook, Add-In, or the Personal.xls If you are lucky then the Class module is somewhere in some workbook, or perhaps saved as a ".cls" file on the hard disk.

  5. #5
    Registered User
    Join Date
    11-02-2010
    Location
    OSEBX
    MS-Off Ver
    Excel 2007
    Posts
    8

    Smile Re: Calendar macro - debugging some old code

    Then I think I'll leave the treasure hunting to the guy who asked me to help out, and hopefully we can figure it out from there. Anyway, I guess this is about as solved this problem is going to get here. Much obliged for helping to get me on the right track with this one, Leith! Expect both reputation and virtual hugs/handshakes coming your way.

    /Black Monday

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1