spar-kle
asked on
A VB macro fails with the error "The requested operation requires elevation." How can I enforce administrator privilege?
I have been using this code for some while.
One of the users has had his PC replaced.
His new PC triggers the following error in Excel:
Run-time error '2157054156 (800702e-4'):
Automation error
The requested operation requires elevation.
When I click the debug button the following code is highlighted
Set OutApp = CreateObject("Outlook.Appl ication")
Please advise
Thanks
One of the users has had his PC replaced.
His new PC triggers the following error in Excel:
Run-time error '2157054156 (800702e-4'):
Automation error
The requested operation requires elevation.
When I click the debug button the following code is highlighted
Set OutApp = CreateObject("Outlook.Appl
Please advise
Thanks
ASKER
If I right click the Excel icon and run as administrator, then open the file within the Excel window it seems to work.
But I really need to write this somehow into the VBA, or change the default settings because of the way our systems work.
But I really need to write this somehow into the VBA, or change the default settings because of the way our systems work.
If it worked before, it could be, that you simply worked as administrator with UAC off - could that be?
ASKER
Thanks for your reply.
The user has the same access and UAC is off.
The user has the same access and UAC is off.
I was asking about the old system. UAC was off there, right?
Now, on the new system, it is off, too? and you rebooted after turning it off?
I am not recommending to solve it by turning off UAC, no. find out what your macro is doing that requires elevation. Does it write to protected folders or registry keys? List those, please.
Now, on the new system, it is off, too? and you rebooted after turning it off?
I am not recommending to solve it by turning off UAC, no. find out what your macro is doing that requires elevation. Does it write to protected folders or registry keys? List those, please.
ASKER
Yes, the UAC was off on the old and the new system. (rebooted too)
The user has local administrator privileges.
It doesn't write to protected folders or keys.
I believe that the elevation is required because the coding writes to an Outlook email.
If Excel isn't opened as Administrator it causes the issue.
The user has local administrator privileges.
It doesn't write to protected folders or keys.
I believe that the elevation is required because the coding writes to an Outlook email.
If Excel isn't opened as Administrator it causes the issue.
Ok, I am not experienced with macro code. You can share it here and I hope that someone else will be able to help you.
Try this.
Open MS Excel
Open the VBA Editor
In the top menu select "Tools - > References"
In the list of "Avaible references" go down an check those who begin with "Microsoft Outlook..."
You can begin with "Microsoft Outlook 14.0 Object Library" if it's unchecked. Back out with OK, to be sure it's loaded, restart MS Excel, then try run your application.
Open MS Excel
Open the VBA Editor
In the top menu select "Tools - > References"
In the list of "Avaible references" go down an check those who begin with "Microsoft Outlook..."
You can begin with "Microsoft Outlook 14.0 Object Library" if it's unchecked. Back out with OK, to be sure it's loaded, restart MS Excel, then try run your application.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Everything works fine after removing DELL security
Right click the script or the program that triggers it and select "run as administrator"