Kyle123
Well-known Member
- Joined
- Jan 24, 2012
- Messages
- 2,771
I am in the unenviable position of coming up with a workbook that does a load of VBA for people with computers that I do not know the spec of. I know the below works when I remove the reference to MSXML, however am I likely to run into any issues should the relevant MSXML library be missing rather than me unselecting whilst testing? I don't know whether missing behaves differently to an unchecked reference.
IDataParser
DataParser
LegacyDataParser
I've previously posted this at EF here, but had no response: https://www.excelforum.com/excel-pr...reference-vs-unchecked-reference-runtime.html
Rich (BB code):
Dim request As IWebRequest
Dim parser As IDataParser
Set request = New DataRequest
request.Url = CONSTANTS.Url
request.Authenticator = CONSTANTS.AUTH_STRING
request.Timeout = 12
request.CallType = Legacy
If LateBind Then
Set parser = New LegacyDataParser
Else
Set parser = New DataParser
End If
Set parser.WebRequest = request
IDataParser
Rich (BB code):
Public Property Set WebRequest(ByVal RHS As IWebRequest): End Property
Public Property Get WebRequest() As IWebRequest: End Property
Public Function GetData() As Variant: End Function
DataParser
Rich (BB code):
Option Explicit
Implements IDataParser
Private m_IWebRequest As IWebRequest
Private Function IDataParser_GetData() As Variant
Dim doc As Object
Set doc = New MSXML2.DOMDocument60
doc.LoadXML m_IWebRequest.GetData
IDataParser_GetData = ParseData(doc)
End Function
'...
LegacyDataParser
Rich (BB code):
Option Explicit
Implements IDataParser
Private m_IWebRequest As IWebRequest
Private Function IDataParser_GetData() As Variant
Dim doc As Object
Set doc = CreateObject("MSXML2.DOMDocument")
doc.LoadXML m_IWebRequest.GetData
IDataParser_GetData = ParseData(doc)
End Function
I've previously posted this at EF here, but had no response: https://www.excelforum.com/excel-pr...reference-vs-unchecked-reference-runtime.html