WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE COM ADO CDO ADSI LDAP
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

1129 OleInitiate Failed UAC

 Keywords: 1129 OleInitiate Failed UAC Windows 7 Win7 64 bit Excel Excel.Application 

Question:

I need to get a handle to an existing instance of Excel. On a PC running Windows XP, this code would do it ...
xl = ObjectGet(,"Excel.Application")
But on my Windows 7 64 bit PC, that exact same code returns an error ... 1129: OleInitiate: Initiate Failed even though I have Excel running and have a workbook open.

Does anyone know what might have changed in Excel v14 or how can I get a handle to an running instance of Excel now?

Details:

  • Windows 7 - 64 bit
  • UAC on
  • Office Professional 2010
  • Excel Version:14.0.5128.5000 (32-bit)
  • Logged in with an administrative account
Thank you.

Answer:

The behavior you are experiencing is the result of the way Excel's and the OS's COM security is interacting with UAC. The result of this interaction is that an Excel object registered in the Running Object Table (ROT) can only be accessed by a client process with the same security token as the process that started Excel.

By default when Excel is started by an admin user it has the low privilege admin security token while a WinBatch script with the '.wbt' file extension starts with the admin elevated token so the two have different security tokens and the script is blocked from accessing the Excel ROT object.

In order to make your script work, you would need to compile the accessing script as 'AsInvoker'/'False', change the uncompiled script's extension from '.wbt' to '.wbt_if', or run Excel with full admin privileges and run your script with the same privileges.

Another approach might be to investigate Excel's COM related security settings and see if there is a way to change them to allow 'Any Client' access to the ROT object. Of course, this approach can be problematic if you plan on distributing your script to others because you would need to insure that all machines have the desired settings.


Article ID:   W18013
Filename:   1129 OleInitiate Failed UAC .txt
File Created: 2013:08:26:09:06:34
Last Updated: 2013:08:26:09:06:34