I am editing a VBA macro that has worked for Office 2003, 2007, 2010, 2013 etc, on any previous OS version of windows we've used. Now that we've upgraded to windows 10, this line of code:
Private m_document As MSXML2.DOMDocument
Doesn't work. It needs to be
Private m_document As MSXML2.DOMDocument60
In context, I am declaring explicit global variables, and this is one of them.
Problem is, I need to edit these macros on my computer, but they need to also work on older OS versions because the product is still used on those versions. I have tried a bunch of stuff to figure out if there's any way to make this work otherwise, no dice. MSXML6 is on both my old (running windows 7) and new computer. So at this point, my hope is for there to be a way to define this variable depending on which OS is being used. I know you can check the OS, I've found code for that, but is there a way to conditionally define the variable based on the OS?
ie:
if windows10
Private m_document As MSXML2.DOMDocument60
else
Private m_document As MSXML2.DOMDocument