0

I have an old program I made several years ago, compiled in Native Code, in Visual Basic 5. I lost the original source code in some old Hard Disk...

It uses a

SendKeys ("{LEFT}")

Then I get this error:

Run-time error '70':
Permission denied

I already disabled UAC, as I did on windows 7 (and worked), but it did not work in windows 8.1 Does anyone know a way around this?

  • 1
    I hope you have tried running as administrator – tumchaaditya Aug 22 '14 at 23:33
  • Yes, I tried that. I set UAC to lowest setting. I also set it to run on Windows XP compatibility mode. On Windows 7 it worked with these settings. On windows 8.1 the Run-time error '70': Permission denied persisted. – Tony Aug 22 '14 at 23:52
  • 1
    Setting the compatibility mode might work: visualbasicnetcode.blogspot.co.uk/p/… – Kev Aug 23 '14 at 2:39
  • 1
    moving the slider down NO LONGER DISABLES UAC in Windows 8.x – magicandre1981 Aug 23 '14 at 6:07
  • 1
    same as in Vista/7. Set the value EnableLUA in the registry (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System) to 0. But this disabled the new store apps. – magicandre1981 Aug 23 '14 at 15:50
2

Paste this inside Project - Add Module - Open

Public Sub Sendkeys(text$, Optional wait As Boolean = False)
   Dim WshShell As Object
   Set WshShell = CreateObject("wscript.shell")
   WshShell.Sendkeys text, wait
   Set WshShell = Nothing
End Sub

You will never face that problem again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.