Office12 COM addin question
-
Hi Guys. My first post in this forumn so please bare with me. I have built an app that references office 12 because I have Office 2007 installed on my PC. However, when I build the exe and install this on another machine it doesn want to work. Is it because the other machine has office 2003 installed on it? Is there an easy way for me to get around this other than having to uninstall Office 2007 from my machine and installing Office 2003 so I can reference the correct com file and build the project with it??
Excellence is doing ordinary things extraordinarily well.
-
Hi Guys. My first post in this forumn so please bare with me. I have built an app that references office 12 because I have Office 2007 installed on my PC. However, when I build the exe and install this on another machine it doesn want to work. Is it because the other machine has office 2003 installed on it? Is there an easy way for me to get around this other than having to uninstall Office 2007 from my machine and installing Office 2003 so I can reference the correct com file and build the project with it??
Excellence is doing ordinary things extraordinarily well.
-
The simplest and most obvious solution is to write a function that determines what version of Office is installed on the LOCAL MACHINE, and then references the existing library component based on that condition.
Thanks for the reply Baltoro but I have no idea how to do this. Do you know of any posts that shows how to do this? I'm just on Google and can't find anything or I might be searching for the wrong thing. :doh:
Excellence is doing ordinary things extraordinarily well.
-
Thanks for the reply Baltoro but I have no idea how to do this. Do you know of any posts that shows how to do this? I'm just on Google and can't find anything or I might be searching for the wrong thing. :doh:
Excellence is doing ordinary things extraordinarily well.
All COM classes have registry entries (this is what the COM Library uses to activate objects). Searching the registry is pretty simple. As I recall, Microsoft applications have thousands of registry keys and values. I would guess enumerating, HKEY_LOCAL_MACHINE\SOFTWARE subkeys for Microsoft subkey, and then specific subkeys for Office 12, and eventually, you're looking for a Current Version subkey and value. Also, you might try searching here: Object Library Reference for Microsoft Office 12[^]