Greetings all,
I need a little assistance. Some background -
I'm working with a split 2007 access database, with a network back end and a run-time front end 'installed' on each users computer. There are up to 300 people using this system at any given time. To facilitate updates to the front end I've written a simple vba project in excel to delete the old front end file from the users program files and copy in the new one that is available on the network. This excel workbook gets called, and the access file closed, from access when a new version is available.
Now, where I'm running into trouble. This process works fine on XP. However, if the UAC on Windows 7 is not turned off, it blocks access to do basically anything to the files stored in Program Files, so I get an error when it tries to delete the old file. I had been just lowering the UAC on the windows 7 computers in the office, but for other reasons i can't leave the UAC lowered.
If I run Excel as administrator first and then open the workbook, it works fine.
So my question - is it possible from VBA to run excel as administrator? I've found code to do this in vb.net, but not from vba.
Or, is it possible to request elevated UAC permissions through vba? Again, I can do it in .net, but haven't found a reference for vba.
Or, does anyone have a better suggestion as to handle the situation.
Thanks!
David
I need a little assistance. Some background -
I'm working with a split 2007 access database, with a network back end and a run-time front end 'installed' on each users computer. There are up to 300 people using this system at any given time. To facilitate updates to the front end I've written a simple vba project in excel to delete the old front end file from the users program files and copy in the new one that is available on the network. This excel workbook gets called, and the access file closed, from access when a new version is available.
Now, where I'm running into trouble. This process works fine on XP. However, if the UAC on Windows 7 is not turned off, it blocks access to do basically anything to the files stored in Program Files, so I get an error when it tries to delete the old file. I had been just lowering the UAC on the windows 7 computers in the office, but for other reasons i can't leave the UAC lowered.
If I run Excel as administrator first and then open the workbook, it works fine.
So my question - is it possible from VBA to run excel as administrator? I've found code to do this in vb.net, but not from vba.
Or, is it possible to request elevated UAC permissions through vba? Again, I can do it in .net, but haven't found a reference for vba.
Or, does anyone have a better suggestion as to handle the situation.
Thanks!
David