Run-time error '70': Permission denied ->when i run code
I have been using this code for over a year and all of a sudden i can not run without getting the Run-time error '70': Permission denied.
I have tried just about every thing and all the webs info on this matter that i have found has not worked.
I have Windows 7 Ultimate. I noticed that my office 2007 completely and excel did an update back 10 days ago but i am sure i used it since then because i have had jobs to complete for the company i use this code on since then. The odd thing is that code very similar to this works for other websites on this same laptop. I have noticed some security pop up which i normally allow but i may have clicked not to once or twice, so i disabled avast security just to see, but nothing same issue. The next thing i thought maybe the owners of the Website itself changed something and now i can't fill out there forms. So i opened the code with my other laptop that is Windows vista and it runs it fine with out any issues. I googled this issue and one post looked to have promise disabling User Account Control, but that did not work either and noticing also that my vista had it activate i should have known this was not going to work. I have three similar codes for the same website that i work with, but all three have the same issue even if i have been working with only one of them in the last few days.
On the code below if the cell "B24" were empty it would normally warn and say "Website is not opened yet", but it does not its steps threw this code and it acts as if the website url is in the "B24" cell and then tries to execute my code and it fails with the Run-time error we are now talking about. Note that it does this either with or without the "B24" cell having the URL in it.
I also thought internet explorer is causing it and is blocking the website, but i could not find it as a blocked website or popup.
So what could be causing this issue. Is it the code that i have not changed and always worked before, Excel program itself, security setting that i may have blocked and had nothing to do with avast security software, any suggestion welcome.
Code:
Public Sub Subject_Click()
Dim objSW As SHDocVw.ShellWindows
Dim objIE As SHDocVw.InternetExplorer
Dim ie As Object
Dim bAppRunning As Boolean
Set objSW = New SHDocVw.ShellWindows
If objSW.Count Then 'new
For Each ie In objSW
If InStr(1, ie.LocationURL, Range("b24")) Then
bAppRunning = True
ie.Visible = True
Do
DoEvents
Loop Until ie.ReadyState = 4
'-----------My Code start here
ie.Document.frames.Item("_MAIN").Document.All.Item("Owner").Value = Range("c54")
ie.Document.frames.Item("_MAIN").Document.All.Item("APN").Value = Range("d54")
'-----------My Code ends here
Exit For
End If
Next ie
End If
If bAppRunning = False Then
MsgBox "Website not Opened Yet"
End If
Set objIE = Nothing
Set objSW = Nothing
End Sub
Issue resolved : Run-time error '70': Permission denied
Found the problem. As i was half way through the process of uninstalling the office 2007 update. I noticed a more recent update for windows 7 on 12/19/14. I figured i would uninstall it and test the code again. Lord be hold the issue is resolved.
The update that I uninstalled and was causing the problem is
"Update for Internet Explorer 11 for Windows 7 for x64-based Systems(KB3025390)" 190BK.
I don't know how i had missed it. I must have gone up and down that list several times.
I don't know what it changed in the process of installation, but if removed issue disappears.
Since issue is resolve i went back to windows update and reinstalled all updates for office 2007 that i just had removed. I tested code again to make sure the office 2007 updates will not cause an issues and NO issue. It is working as it should.
Sorry for wasting peoples time by not seeing that update, but hopefully this will help the next person with this similar issue. Now i am back to work.
Till the next issue.
Thank you all for trying to help me and for teaching me on improving my code.