Share via

Excel VBA missing reference SOAP

Anonymous
2018-08-20T10:39:51+00:00

I recently got a new notebook. When trying to get SharePoint information (Members, Groups) with my Excel macro I can see that there is a missing reference for SOAP now.

I manually selected the correct DLLs but still I get a Compile Error

"User-defined type not defined" for the line

Dim soapClient As MSXML2.XMLHTTP: Set soapClient = New MSXML2.XMLHTTP

The Excel macro runs perfect on my notebook with O365 / Win7 but not on the new one with O365 / Win10.

Any idea?

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Andreas Killer 144.1K Reputation points Volunteer Moderator
    2018-08-20T14:49:00+00:00

    If you use the object identifiers in your declaration you have must set the correct references within Tools\References

    This can be a problem if you want to use the same file/code on different PCs.

    The solution on this is to rewrite the code from early binding to late binding.

    https://support.microsoft.com/en-us/help/245115...

    Remove the reference to "Microsoft XML v3.0" and change the code to this

    Dim soapClient As Object 'MSXML2.XMLHTTP
    Set soapClient = CreateObject("MSXML2.XMLHTTP")
    

    Add the line

    Option Explicit
    

    at the top of the module, then click Debug\Compile.

    That's the best way to find undeclared variables, resp. constants that you use anywhere in the code.

    Andreas.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2018-08-20T10:48:38+00:00

    Hi,

    I am an Independent Advisor here to help you. I'm sorry to hear that you're having difficulties.

    Could you please provide a link to the document?

    Please let me know I'm happy to try to solve your problem.

    Was this answer helpful?

    0 comments No comments