Discussion:
Operation Requires Elevation
(too old to reply)
R C Nesbit
2012-03-29 12:42:05 UTC
Permalink
I have a VB6 app which is running quite happily in a number
of mixed (XP/Vista?W7/2008) environments in a number of
sites.

One W7 machine recently fried it's HDD and had to be
completely re-installed from scratch.

It is running my app. from a share on a Vista machine.
After a few stumbles we finally persuaded it to run Fine,
except when it wants to generate an output via an excel
template.

Code snipet:

Set oExcel = New Excel.Application
Set oWB = oExcel.Workbooks.Open(sFile)
Set oWS = oWB.ActiveSheet

'sFile' is a .xlt file in app.path\Templates on the server.

This machine fails every time, and my error log reports:
"the requested operation requires elevation"
--
Rob Pearson
Mayayana
2012-03-29 13:34:59 UTC
Permalink
Under normal conditions you don't have access to much
other than the user App Data folder on Vista/7. I was
recently testing a VBScript on Win7 that creates and
uses an IE instance as an HTA. I had no problem with
that, but Win7 wouldn't let me, as Admin, put an image
file on C drive (needed for the test) without elevation!

When it comes to Vista/7, with the exception of
whatever you set up during program install, you have to
assume that you're running as a corporate employee who
has no right to do anything but send email or write MS
Office files that are auto-saved to their docs folder. That
employee is not even supposed to know about the file
system (from Microsoft's point of view), and Windows/MS
Office is increasingly designed to enforce that.

You can change permissions programmatically on your
program subfolders during install. That's what I do, so that
I have a location to work with temp files, etc. Or you can
create a folder in App Data and then don't try to do
anything anywhere else. The standard protocol for that is
to create a company folder first, so it would be like:
...\CompanyName\ProgramName\Templates\

|
| One W7 machine recently fried it's HDD and had to be
| completely re-installed from scratch.
|
| It is running my app. from a share on a Vista machine.
| After a few stumbles we finally persuaded it to run Fine,
| except when it wants to generate an output via an excel
| template.
|
| Code snipet:
|
| Set oExcel = New Excel.Application
| Set oWB = oExcel.Workbooks.Open(sFile)
| Set oWS = oWB.ActiveSheet
|
| 'sFile' is a .xlt file in app.path\Templates on the server.
|
| This machine fails every time, and my error log reports:
| "the requested operation requires elevation"
|
| --
| Rob Pearson
|
|
|
ralph
2012-03-29 13:33:04 UTC
Permalink
Post by R C Nesbit
I have a VB6 app which is running quite happily in a number
of mixed (XP/Vista?W7/2008) environments in a number of
sites.
One W7 machine recently fried it's HDD and had to be
completely re-installed from scratch.
It is running my app. from a share on a Vista machine.
After a few stumbles we finally persuaded it to run Fine,
except when it wants to generate an output via an excel
template.
Set oExcel = New Excel.Application
Set oWB = oExcel.Workbooks.Open(sFile)
Set oWS = oWB.ActiveSheet
'sFile' is a .xlt file in app.path\Templates on the server.
"the requested operation requires elevation"
Most likely a confusion over "ownership" of the file.

My guess is that these files were restored by harvesting from other
PCs and not from a backup. This is a common problem when restructuring
or otherwise performing a mass shuffling of files from one PC to
another. Plenty of examples online. Here is one.

http://answers.microsoft.com/en-us/windows/forum/windows_7-files/the-requested-operation-requires-elevation/4d45a50e-2e5d-49f7-950c-e6281057491f

-ralph

Loading...