Welcome to the Excel Forum

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.

Please Register to Remove these Ads

Please Register to Remove these Ads



Reply
  #1  
Old 02-09-2006, 05:17 AM
matpj matpj is offline
Forum Contributor
 
Join Date: 14 Mar 2005
Posts: 163
matpj is becoming part of the community
Running URL using VBA - but not displaying IE window

Please Register to Remove these Ads

I need to run a URL usnig VBA (this in turn runs a Lotus Notes Agent).
This needs to happen in the back ground if possible, without displaying Internet Explorer - or at least keeping IE in the background and then closing it once run)

can anybody advise?


thanks in advance,
Matt
Reply With Quote
  #2  
Old 02-09-2006, 05:40 AM
Robin Hammond
Guest
 
Posts: n/a
Re: Running URL using VBA - but not displaying IE window

Matt,

This is cut out of a much larger routine, but should point you in a possible
direction. It doesn't go anywhere near IE.

'set a project reference to ms xml 4, preferably with service packs
installed
Sub XMLPostToWebPage()
Dim oXML As MSXML2.XMLHTTP40
Dim strIp as string, strPost As String

Set oXML = New MSXML2.XMLHTTP40
strIP = http://nnn.nnn.nnn.nnn/ ' or a web address
strPost = strIP & "index.html" 'change to your web page

'if the page takes parameters, add them here in the same way I have added
the dummy var below,
'and change the question mark before dummy to an ampersand

'append a dummy var to make sure the page refreshes
Randomize
strPost = strPost & "?Dummy=" & CInt(1000 * Rnd())

With oXML
.Open "POST", strPost, False
.send
If .Status <> 200 Then
Call MsgBox("An error occured. " & _
"The error messages received were: " & vbcrlf & vbcrlf & _
.responseText, vbInformation, msgTitle)
End If
End With
Set oXML = Nothing
End Sub

Robin Hammond
www.enhanceddatasystems.com



"matpj" <matpj.22yj3a_1139480403.6998@excelforum-nospam.com> wrote in
message news:matpj.22yj3a_1139480403.6998@excelforum-nospam.com...
>
> I need to run a URL usnig VBA (this in turn runs a Lotus Notes Agent).
> This needs to happen in the back ground if possible, without displaying
> Internet Explorer - or at least keeping IE in the background and then
> closing it once run)
>
> can anybody advise?
>
>
> thanks in advance,
> Matt
>
>
> --
> matpj
> ------------------------------------------------------------------------
> matpj's Profile:
> http://www.excelforum.com/member.php...o&userid=21076
> View this thread: http://www.excelforum.com/showthread...hreadid=510508
>



Reply With Quote
  #3  
Old 02-09-2006, 06:01 AM
matpj matpj is offline
Forum Contributor
 
Join Date: 14 Mar 2005
Posts: 163
matpj is becoming part of the community
thanks Robin,

i'll check that out and hopefully get the result!!

Matt
Reply With Quote


Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump