Page 1 of 2 12 LastLast
Results 1 to 10 of 13

VBA compatibility in 2003 vs 2010

This is a discussion on VBA compatibility in 2003 vs 2010 within the Excel Questions forums, part of the Question Forums category; Hi everyone, I have created a UserForm to which I embedded a Spreadsheet and a ChartSpace object in VBA 2003. ...

  1. #1
    Board Regular
    Join Date
    May 2011
    Posts
    90

    Default VBA compatibility in 2003 vs 2010

    Hi everyone,

    I have created a UserForm to which I embedded a Spreadsheet and a ChartSpace object in VBA 2003. When I upgraded to Office 2010, my form does not work. I get a message when I load the Excel file:
    "Could not load some objects because they are not available on this machine". When I press Ok, another error message appears:
    "Compile Error: Cannot find project or library". When I press help, then Excel suggests I go to References and select the missing reference etc. Howerver, Debug does not let me go to menu items. I simply cannot stop code execution and Reference menu item is dimmed in debug mode.

    I came across in the internet that some controls are not supported in Office 2010. Just to make sure, I present a small excerpt from the form below, which worked just fine with Office 2003:

    Code:
    With myForm.Spreadsheet1
          .Range("b2").Value = 100
          ...
     
    With myForm.ChartSpace1
          .DataSource = myForm.Spreadsheet1
          ...
    How can I stop debug and go to References to find the missing reference?
    What might be wrong? Is there a compatibility issue between 2003 and 2010?

    I initially used Office 2010 64 bit version, when I see the error, I switched back to 32 bit Office 2010. But the problem still resides...

    Many thanks in advance...

  2. #2
    Board Regular Trevor G's Avatar
    Join Date
    Jul 2008
    Location
    Tamworth, Staffordshire
    Posts
    5,751

    Default Re: VBA compatibility in 2003 vs 2010

    Before you run the code, Open your workbook and use ALT + F11 then you will be able to select the Tools Menu and References and see what it tells you is missing in the 2010 version then you can remove the tick from the missing item and search down for a version of that item if it is available to you.
    Trevor
    I am on a learning curve of life, I know a little but like to share what I have learnt with others.
    I am using Microsoft Office 2003 to 2013
    Please remember everyone here is a volunteer, so if you have had a reply to your thread be courteous and acknowledge this.

  3. #3
    Board Regular
    Join Date
    May 2011
    Posts
    90

    Default Re: VBA compatibility in 2003 vs 2010

    In fact, I don't particularly run the code. The error message appears when i load the Excel file... Therefore Alt-F11 trick does not work out.

  4. #4
    MrExcel MVP
    Moderator
    Smitty's Avatar
    Join Date
    May 2003
    Location
    Crested Butte, CO
    Posts
    27,280

    Default Re: VBA compatibility in 2003 vs 2010

    Once you get into the VBE you first need to goto Run-->Reset, which will clear the Debug mode. From there you can check your references.
    Smitty

    Every once in a while, there's a sudden gust of gravity...

    Check out my new book at the Mr. Excel Bookstore!

    Mr. Excel HTML Maker - Post a shot of your sheet

  5. #5
    Board Regular Trevor G's Avatar
    Join Date
    Jul 2008
    Location
    Tamworth, Staffordshire
    Posts
    5,751

    Default Re: VBA compatibility in 2003 vs 2010

    Then do you have something happening within the workbook open event? What happens if when you open the workbook and the debug comes up, do you go into the code screen and have you considered using the Run Menu and Stop then you will also be able to get to the Tools Menu and References.
    Trevor
    I am on a learning curve of life, I know a little but like to share what I have learnt with others.
    I am using Microsoft Office 2003 to 2013
    Please remember everyone here is a volunteer, so if you have had a reply to your thread be courteous and acknowledge this.

  6. #6
    Board Regular
    Join Date
    May 2011
    Posts
    90

    Default Re: VBA compatibility in 2003 vs 2010

    Quote Originally Posted by Smitty View Post
    Once you get into the VBE you first need to goto Run-->Reset, which will clear the Debug mode. From there you can check your references.

    Run\Reset brings up the error windows saying: "Compile Error: Cannot find project or library". I just can't get rid of it.

  7. #7
    Board Regular
    Join Date
    May 2011
    Posts
    90

    Default Re: VBA compatibility in 2003 vs 2010

    Quote Originally Posted by Trevor G View Post
    Then do you have something happening within the workbook open event? What happens if when you open the workbook and the debug comes up, do you go into the code screen and have you considered using the Run Menu and Stop then you will also be able to get to the Tools Menu and References.
    Nope. I have a function in Workbook_Close but not in Workbook_Open. Therefore, no reason for the code to execute by itself, in fact...

  8. #8
    Board Regular
    Join Date
    May 2011
    Posts
    90

    Default Re: VBA compatibility in 2003 vs 2010

    Furthermore,

    My only current way of closing the Excel file is from the task manager. I simply terminate Excel there...

    I should say, the Excel file imports data from an exernal file; but doesn't ask if I want to get new data. It was asking before. Some sort of alteration in settings after I upgraded to Office 2010, perhaps?

  9. #9
    Board Regular Trevor G's Avatar
    Join Date
    Jul 2008
    Location
    Tamworth, Staffordshire
    Posts
    5,751

    Default Re: VBA compatibility in 2003 vs 2010

    Try disabling all the macro setting from the File Tab and Options and Trust Centre. Trust Centre Settings on the right then Macros on the Left and Disable All Macros, check the workbook and then if you find the problem you can sort it then change the settings back.
    Trevor
    I am on a learning curve of life, I know a little but like to share what I have learnt with others.
    I am using Microsoft Office 2003 to 2013
    Please remember everyone here is a volunteer, so if you have had a reply to your thread be courteous and acknowledge this.

  10. #10
    Board Regular
    Join Date
    May 2011
    Posts
    90

    Default Re: VBA compatibility in 2003 vs 2010

    Thank you @Trevor G,

    This time I could manage to bypass the code execution and reach out the References menu item. It seems there truly is a line there:
    "MISSING: Microsoft Office Web Components 11.0"

    How can I find that file? Where is it?

Page 1 of 2 12 LastLast

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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


DMCA.com