A Microsoft Excel forum. ExcelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ExcelBanter forum » Excel Newsgroups » Excel Programming
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Using IE from VBA - Permission Denied



 
 
Thread Tools Display Modes
  #1  
Old July 20th 12, 12:56 PM posted to microsoft.public.excel.programming
Madiya
external usenet poster
 
Posts: 232
Default Using IE from VBA - Permission Denied

Here is my code.


Dim ie As InternetExplorer
Dim ipf As Object

Set ie = CreateObject("InternetExplorer.Application")<<<<<t his is failed line

I have set referance to "Microsoft internet controls".

I am getting run time error 70 - Permission Denied.

Uptill today it was working fine. No new softwares installed / uninstalled.

Pl help.

Madiya
Ads
  #2  
Old July 21st 12, 10:03 AM posted to microsoft.public.excel.programming
Walter Briscoe
external usenet poster
 
Posts: 179
Default Using IE from VBA - Permission Denied

In message > of
Fri, 20 Jul 2012 04:56:52 in microsoft.public.excel.programming, Madiya
> writes
>Here is my code.
>
>
>Dim ie As InternetExplorer
>Dim ipf As Object
>
>Set ie = CreateObject("InternetExplorer.Application")<<<<<t his is failed line
>
>I have set referance to "Microsoft internet controls".
>
>I am getting run time error 70 - Permission Denied.
>
>Uptill today it was working fine. No new softwares installed / uninstalled.


I assume you have rebooted.
In Excel 2003, I created the following code.

Option Explicit

Sub Macro1()
Dim ie As InternetExplorer

Set ie = CreateObject("InternetExplorer.Application")
End Sub

As expected, when I ran the code, "Dim ie As InternetExplorer" got
"Compile error
User-defined type not defined"

That was fixed by stopping the code, selecting Tools\References and
checking "Microsoft Internet Controls".

I then found the code ran correctly. I am sorry I have no idea why you
are getting an error 70.

I have a follow up question.
The code depends on a reference to "Microsoft Internet Controls".
Has anybody got code which will set that reference programatically?
i.e. I want code for a procedure SetReference with a call
SetReference "Microsoft Internet Controls".

I have seen code which uses GUIDs as input to replace missing
references. <http://www.vbaexpress.com/kb/getarticle.php?kb_id=267>
I want code, which starts with a clean slate and sets a reference.

I would be happy with an explanation on why what I want is impossible.

There is a second question. How can I tell that InternetExplorer is
resolved by Microsoft Internet Controls?

My own code uses
Public IE As SHDocVw.InternetExplorer ' Needs Tools/References/Microsoft Internet Controls
....
Set IE = CreateObject("InternetExplorer.Application.1")

I assume SHDocVw.InternetExplorer and InternetExplorer are equivalent.
It can do no harm to try the substitution.
--
Walter Briscoe
  #3  
Old July 24th 12, 01:05 PM posted to microsoft.public.excel.programming
Madiya
external usenet poster
 
Posts: 232
Default Using IE from VBA - Permission Denied

Thanks Walter.
Sorry I couold not post reply due to some urgent assignment.

Mine was indeed a permission issue.
I tried to restore my pc to an earlier restore point which resolved the issue.
I think if you want to run the code without referances, its possible and is called late binding. But I am not an expert to comment much on the same althouogh I have seen many code snippets with late binding.

Regards,
Madiya

On Saturday, 21 July 2012 14:33:46 UTC+5:30, Walter Briscoe wrote:
> In message &gt; of
> Fri, 20 Jul 2012 04:56:52 in microsoft.public.excel.programming, Madiya
> &lt;madiya122 at yahoo.co.uk&gt; writes
> &gt;Here is my code.
> &gt;
> &gt;
> &gt;Dim ie As InternetExplorer
> &gt;Dim ipf As Object
> &gt;
> &gt;Set ie = CreateObject(&quot;InternetExplorer.Application&qu ot&lt;&lt;&lt;&lt;&lt;this is failed line
> &gt;
> &gt;I have set referance to &quot;Microsoft internet controls&quot;.
> &gt;
> &gt;I am getting run time error 70 - Permission Denied.
> &gt;
> &gt;Uptill today it was working fine. No new softwares installed / uninstalled.
>
> I assume you have rebooted.
> In Excel 2003, I created the following code.
>
> Option Explicit
>
> Sub Macro1()
> Dim ie As InternetExplorer
>
> Set ie = CreateObject(&quot;InternetExplorer.Application&qu ot
> End Sub
>
> As expected, when I ran the code, &quot;Dim ie As InternetExplorer&quot; got
> &quot;Compile error
> User-defined type not defined&quot;
>
> That was fixed by stopping the code, selecting Tools\References and
> checking &quot;Microsoft Internet Controls&quot;.
>
> I then found the code ran correctly. I am sorry I have no idea why you
> are getting an error 70.
>
> I have a follow up question.
> The code depends on a reference to &quot;Microsoft Internet Controls&quot;.
> Has anybody got code which will set that reference programatically?
> i.e. I want code for a procedure SetReference with a call
> SetReference &quot;Microsoft Internet Controls&quot;.
>
> I have seen code which uses GUIDs as input to replace missing
> references. &lt;http://www.vbaexpress.com/kb/getarti...?kb_id=267&gt;
> I want code, which starts with a clean slate and sets a reference.
>
> I would be happy with an explanation on why what I want is impossible.
>
> There is a second question. How can I tell that InternetExplorer is
> resolved by Microsoft Internet Controls?
>
> My own code uses
> Public IE As SHDocVw.InternetExplorer ' Needs Tools/References/Microsoft Internet Controls
> ...
> Set IE = CreateObject(&quot;InternetExplorer.Application.1& quot
>
> I assume SHDocVw.InternetExplorer and InternetExplorer are equivalent.
> It can do no harm to try the substitution.
> --
> Walter Briscoe


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Permission Denied Varne Excel Programming 2 January 22nd 10 11:12 PM
CopyFolder Permission Denied, but who by? DartGuru Excel Programming 0 April 27th 07 09:05 AM
permission denied SandyR Excel Programming 2 November 16th 05 01:53 PM
Permission to use object denied WilDeliver[_2_] Excel Programming 2 October 22nd 04 07:46 PM
Permission Denied Audrey Ng Excel Programming 1 October 1st 03 07:20 AM


All times are GMT +1. The time now is 03:48 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright ©2004-2013 ExcelBanter.
The comments are property of their posters.