Nam G VU
Nam G VU

Reputation: 35384

Do we need to dispose object in an Excel .xlam addin?

Let's say we have such code as below

'Call service
Set xmlhttp_ = CreateObject("MSXML2.xmlhttp")
xmlhttp_.Open "GET", url, False
xmlhttp_.send
result = (xmlhttp_.responseText)

sendRequest = result

Do we need to dispose xmlhttp_ after used?

Upvotes: 1

Views: 724

Answers (1)

Tim Williams
Tim Williams

Reputation: 166341

It should be automatically disposed as soon as it goes out of scope. See Matthew Curland's response here:

https://groups.google.com/forum/?hl=en&fromgroups#!topic/microsoft.public.dotnet.languages.vb/3pw-TGc9PSo

Upvotes: 2

Related Questions