Migrating to Excel 2010 - Have workbook that uses Excel 10 worksheets and OWC10 in VBA
Posted on 2010-11-15
I'm thinking that there's a relatively smooth way to do this, but maybe not.
I have an Excel workbook with extensive VBA that was developed using OWC10 charts and a few instances of the Excel Worksheet control on some forms.
When I moved from Excel 2002 to Excel 2003, things were relatively painless. Opening the workbook for the first time on the new system worked - no error message about missing controls or compile errors that indicated a missing OWC10.dll.
Opening the same workbook on an Excel 2007 machine worked, as long as I made sure that OWC10.dll was installed. (at least that's what I remember - it's been a few months.)
All this time the workstations were running WinXP SP3.
I'm now testing this workbook on a Win7 machine with Office 2010 and running into some issues when I first open the workbook. I get multiple "Could not load some objects because they are not available on this machine." messages - these seem to be one for each instance where I use the Excel Worksheet object. This is not available by default, apparently. When I open the code, and then the form, these instances of the xlworksheet object are gone.
I also get a couple of "Compile error in xxxxx module..." errors that I know can be solved by defining the location of the OWC10.dll in the VBA References.
My question is this:
How can I predispose Excel 2010 to accept this workbook? Is there some setup that I can do in Excel that will make sure these references and objects are available to all workbooks before they are opened for the first time? If not that, is there some remedy I can apply after opening the first time that will preserve those xlworksheet instances?
I understand that OWC is NOT the way to go into the future, and we're working on eliminating these controls, but in the meantime I also have read that with proper preparation I should be able to use these legacy controls until I complete the changes.
Any help please?