Close Browser window with VBA

B

brianelson

I have the following code that sends a message to a web
page and tehn to a pager. bypassing the outlook object
model gaurd BUT it opens a new web page window. and I
want to close the windows after it is done sending.

Sub sendtopagers()
txtMessage = "Test"
PagerNumber = "2081234567"
fulltest = "PIN=" & PagerNumber & "&MSSG=" & txtMessage
& "&Q1=0"

ThisWorkbook.FollowHyperlink "http://www.Arch.com/cgi-
bin/wwwpage.exe", , True, , fulltest, msoMethodPost


Any Help would be apprecieated

Brian Elson
 
O

Orlando Magalhães Filho

Hi Brianelson,

I don't know if I understood your question, but I think you have to handle
the IE as object with a code like this rough:

' =======Start Code=======
Dim IEObj As Object

Sub Test()
OpenIE "http://example.microsoft.com"
IEObj.Quit
Set IEObj = Nothing
End Sub

Public Sub OpenIE(vURL As String)
On Error GoTo ErrorHandler
IEObj.Visible = True
With IEObj
.Visible = True
.Navigate vURL
Do Until Not .Busy
DoEvents
Loop
End With
Exit Sub
ErrorHandler:
Set IEObj = Nothing
Set IEObj = CreateObject("InternetExplorer.Application")
Resume Next
End Sub
'======End Code========
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top