Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: Excel ObjectGet Win7 Windows 7 UAC
WB2011A Win7 Home Premium SP1 Office 2003I'm having difficulty getting WB to access an existing instance of Excel.
Although two workbooks are open, the below code opens a new instance of Excel and terminates with the message that there is no active workbook.
oXL = ObjectGet(, "Excel.Application") oXL.visible = @TRUE oActiveWorkbook = oXL.ActiveWorkbook Terminate(oActiveWorkbook==0,`Excel Status`,`No Active Workbook`) Message(`Active Workbook`,oActiveWorkbook.Name)
I could easily be wrong but given the facts that the debug trace indicates that the script is elevated, that Excel does not by default launch elevated, that an elevated processes cannot access a reduced privileges process's ROT entries, I am putting my wooden nickel on a UAC problem.
If uac elevation is the cause then maybe modifying the manifest settings used could have an effect. The easiest way to confirm that UAC is the cause is to change the extension of the script attempting to attach to Excel from 'wbt' to 'wbt_if' and launch it from a shell Explorer windows. If it works with an existing Excel instance, cause confirmed.
Article ID: W18107
Filename: Excel ObjectGet and UAC.txt
File Created: 2012:05:31:08:24:34
Last Updated: 2012:05:31:08:24:34