Results 1 to 6 of 6
  1. #1
    3 Star Lounger
    Join Date
    Aug 2004
    Posts
    361
    Thanks
    0
    Thanked 0 Times in 0 Posts

    VBA Not working (2007)

    Recently upgraded to 2007. Have found that some of the VBA coding from Excel XP does not function in 2007.Do I have to do a bunch of re-coding (ugh) or is there a simpler method to convert the XP workbooks to operate properly in 2007? thanks.

  2. #2
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: VBA Not working (2007)

    Some of the common scenarios around your question are:

    1. VBA is not installed when the person upgraded to 2007. In this case, the VB button on the Developer tab is greyed out! (I doubt this is your problem)
    2. Security settings are preventing the code from running. Ensure that you have responded to the prompt to allow the code to run, and check that the code is not being blocked because it is not from a trusted location or publisher.
    3. If both above are OK, then maybe the code is debugging as due to objects or properties/methods that have changed. In this event, the code will need to be edited to correct the incompatible lines.

    If none of the above apply in your case, could you please supply us a snippet of the code that is causing the problem. It will help us to evaluate what is happening and provide a solution.

    PS: Are you able to step through the code. Is it running some of the code and then stopping?
    Regards,
    Rudi

  3. #3
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA Not working (2007)

    Have you got some examples of lines that fail?
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  4. #4
    3 Star Lounger
    Join Date
    Aug 2004
    Posts
    361
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA Not working (2007)

    The spreadsheet is attached. The code I found on the web. It worked fine in XP and 2000. As you can see you are to click on a cell in Col A and a pop-up calendar should appear. I have allowed macros to run. When I attempt to run it I get Compile Error: Can't find project or library.
    Attached Files Attached Files

  5. #5
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: VBA Not working (2007)

    If you go to VBA and check tools - references are there any listed as missing?
    Is there a similarly named one in the list that you can check? I can not not check (I don;t have XL2007) but it may have updated libraries or one did not get installed

    Steve

  6. #6
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA Not working (2007)

    Your file uses the calendar control, which is not a native part of every Office installation to begin with. On my Office 2007 the file works fine, so I seem to have the control (Office 2007 Ultimate).
    Like Steve said: check Tools, references in the VBA editor and see if the calendar control is marked as "MISSING". You CAN download the calendar control from Microsoft though.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

Posting Permissions

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