Consulting

Results 1 to 12 of 12

Thread: Run-time error '70': Permission denied ->when i run code

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    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.

    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
    Last edited by SamT; 12-22-2014 at 11:59 AM. Reason: Formatted Code with # icon

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •