VBA compatibility in 2003 vs 2010

eros

Board Regular
Joined
May 6, 2011
Messages
90
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...
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
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.
 
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0
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...
 
Upvote 0
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?
 
Upvote 0
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.
 
Upvote 0
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?
 
Upvote 0

Forum statistics

Threads
1,223,744
Messages
6,174,253
Members
452,553
Latest member
red83

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top