Checking for Reference errors in Excel
January 5th, 2009I am having an VBA application in which i am using Word objects to save documents and print from excel. I add the reference to MSWord9.OLB(2000) on workbook load. But when the same workbook is loaded on a 97 or an XP m/c it fails b'cos the .OLB file for the other versions of the OS r different. IS there anyway to know version of the MSWord(x).OLB used for a particular OS. Also is there a way to check for references and remove them if they are missing.
If there are missing references and we compile it is giving errors at odd locations.
Thanks
Veera
How are you adding it? GUID?
Check this out:
http://www.mrexcel.com/board2/viewtopic.php?t=50211
If you set the major integer to 1 and minor to 0, it'll grab the lowest version available in the references, which should work. It also tests to see if a reference exists, if so, don't add another, if not, add the lowest available. And set up a boolean to tell you later to remove the reference if you added it. Return the settings back to those before you tampered with them if you will.
Hope this helps.
#If you have any other info about this subject , Please add it free.# |