-
Apr 20th, 2010, 04:02 PM
#1
Thread Starter
New Member
Permission denied error 70: With XP SP3, Office 2007, Internet Explorer 8 VB6.5
Hello,
I am looking for ideas to help me resolve an issue on my development machine.
XP SP3, Office 2007, Internet Explorer 8, VB6.5
Using the code posted here http://www.excelforum.com/excel-prog...-internet.html I am getting the pretty frustrating Permission denied Error 70 - but only when I set the value of q to SearchTest. (Works fine up until then)
I have signed and trusted myself in Excel.
I have told IE that Google is a trusted site.
I have trusted the Macro with access to the VBA project Object Model.
(and I have tried a few more desperate approaches).
But all to no avail.
Is there perhaps even a way to track where the error code is generated? Any clues would be much appreciated.
Thank you
GEB
Last edited by GazEdBro; Apr 21st, 2010 at 07:38 AM.
Reason: Fixed
-
Apr 21st, 2010, 02:52 AM
#2
-
Apr 21st, 2010, 03:07 AM
#3
Thread Starter
New Member
Re: Permission denied error 70: With XP SP3, Office 2007, Internet Explorer 8 VB6.5
I am puzzled by the comment about not pasting code -since I provided a link instead. q and btnG are the field names from the site. I have of course tried this on other sites with the correct field names but all to no avail.
GEB
-
Apr 21st, 2010, 03:55 AM
#4
Re: Permission denied error 70: With XP SP3, Office 2007, Internet Explorer 8 VB6.5
I am puzzled by the comment about not pasting code
he meant you should understand the code, not just blindly copy
i have no idea why you are getting the error as i use code like that all the time, but i am using earlier version of IE and excel
post your code so we can see what you are trying to do, and show which line you get the error
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Apr 21st, 2010, 04:04 AM
#5
Thread Starter
New Member
Re: Permission denied error 70: With XP SP3, Office 2007, Internet Explorer 8 VB6.5
My problem is that I thoroughly understand the code, but I can't seem to find out which bit of the system is throwing the exception - actually I would also like to know why - but at least if I knew if it was the IE control or XP etc. I could move forward. But thanks for taking an interest - it is greatly appreciated.
'Written: October 11, 2007
'Author: Leith Ross
'This code first requires setting a reference to Microsoft Internet Controls.
'In the Object Browser the properties, methods, and events appear under SHDocVw.
Sub VisitSite()
Dim IEapp As Object
Dim IEdoc As Object
Dim SearchText As String
Dim URL As String
URL = "http://www.google.com/"
SearchText = "Excel help"
Set IEapp = New InternetExplorer
' Launch Internet Explorer and go to the site
With IEapp
.Visible = True
.Navigate URL
End With
' Wait until Internet Explore finishes loading
While IEapp.Busy
DoEvents
Wend
' Insert search text
Set IEdoc = IEapp.Document
IEdoc.All("q").Value = SearchText
' Wait till the page is loaded
While IEapp.Busy
DoEvents
Wend
' Clicks the button named "btnG" which is google's search button
IEdoc.All("btnG").Click
While IEapp.Busy
DoEvents 'wait until IE is done loading page.
Wend
End Sub
-
Apr 21st, 2010, 04:27 AM
#6
Re: Permission denied error 70: With XP SP3, Office 2007, Internet Explorer 8 VB6.5
you can step through the code line by line to find where the error occurs use F8 key
the code works without error here,
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Apr 21st, 2010, 05:55 AM
#7
Thread Starter
New Member
Re: Permission denied error 70: With XP SP3, Office 2007, Internet Explorer 8 VB6.5
It stops here:
IEdoc.All("q").Value = SearchText
Sorry I thought I'd made that clear in the original post. And yes, Internet Explorer does pop up and successfully navigate to Google.
GEB
-
Apr 21st, 2010, 06:13 AM
#8
Re: Permission denied error 70: With XP SP3, Office 2007, Internet Explorer 8 VB6.5
i would presume the the error is caused by internet explorer
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Apr 21st, 2010, 07:35 AM
#9
Thread Starter
New Member
Re: Permission denied error 70: With XP SP3, Office 2007, Internet Explorer 8 VB6.5
I've got it.
Looking under the Locals Window under IEapp.Document.all I see just an Object "constructor" and 2 Long types "ie8_length" and "length" each with the value <Permission denied>. So it appears that my issue was connected to the implementation of the InternetExplorer control with IE8. By re-writing the code
to
IEdoc.getElementById("q").Value = SearchTest
it avoids the problem.
My copy of Office is brand new so it could be that "all" is on its' way out - obviously I don't know that for sure but it might be worth watching out for.
Thanks for your help
GEB
-
Apr 21st, 2010, 04:17 PM
#10
Re: Permission denied error 70: With XP SP3, Office 2007, Internet Explorer 8 VB6.5
thanks for posting your solution, i will keep it in mind
i would believe it is more to do with later versions of internet explorer security, than the office version
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|