Change

Tim Francis-Wright

Board Regular
Joined
Feb 19, 2002
Messages
76
Office Version
  1. 2013
Platform
  1. Windows
I maintain spreadsheets at work that have a number of macros in them, and it's almost time to upgrade the Excel that everyone uses from 2013 to 2016. For most of the macros, the change matters not at all, but two of the macros interact with other programs, and (of course) they use early binding. Right now, the one person using Office 2016 has anyone using the new Excel has been saving his work, and when his Office 2013 colleagues open the file, they get a (fatal) error because Excel 2013 cannot access the Office 16.0 Object Library.

I know the way around this is to use late binding instead of early binding; I was able to fix Problem Macro A (which interacts with Outlook). But Problem Macro B is still a problem.

Here is the existing, early binding code snippet:
VBA Code:
'Problem Macro B ("PMB")
Dim requestXML As New MSXML2.XMLHTTP30
'Other, potentially sensitive lines excised

That code works fine on my machine, which has the following references:
Rich (BB code):
Visual Basic for Applications
Microsoft Excel 15.0 Object Library
Microsoft Forms 2.0 Object Library
Microsoft XML, v6.0

I attempted to convert PMB to late binding:
VBA Code:
Dim requestXML As Object
Set requestXML = CreateObject("MSXML2.XMLHTTP.3.0")

I have seen in different places other possibilities for the CreateObject reference ("MSXML2.XMLHTTP30", "MSXML2.XMLHTTP", "MSXML2.XMLHTTP60", etc.) None work. The error I consistently get is 429, "ActiveX component can't create object." What do I need to do to get late binding to work here?
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Try:
VBA Code:
Set requestXML = CreateObject("MSXML2.XMLHTTP.6.0")
It doesn't error, however it's giving me "This method cannot be called until the sent method is called"
 
Upvote 0
I know this is an old thread, but I recently discovered that instead of

VBA Code:
Set requestXML = CreateObject("MSXML2.XMLHTTP.6.0")

which fails, I can use

VBA Code:
Set requestXML = CreateObject("MSXML2.XMLHTTP")

and it works.
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top