I had Excel 2010 and Office 365 installed at the same time on my computer. I uninstalled the 365 version due to other issues and now my code crashes when accessing the TextRange2 class. Specifically in the line of code
chart.Legend.Format.TextFrame2.TextRange.Font.Size = 12;
It tells me that the TextRange2 class is not registered. I don't understand anything because if I record a macro with Excel 2010 doing exactly the same, i.e. changing the font size of the legend of a chart, the code it generates is exactly the same.
What is going on?
Thanks
I've already managed to fix it :-)
I had to delete the 2.8 or 2.9 folder (I don't remember which one I had and it was empty) from the registry entry HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Classes\TypeLib{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52} and leave only the 2.5 folder which is the correct version of Office 2010.
You can see that the 365 uninstaller doesn't properly clean everything it creates when you install it and leaves rubbish that affects previous versions :-@
Link (in Spanish) where I found the solution:
https://answers.microsoft.com/es-es/msoffice/forum/all/falta-una-referencia-al-archivo-msodll/4a1589dc-a689-4b34-a8eb-0a5ed1737cf9
@FaneDuru Thank you very much :-)