Opening IE with VBA

M

Mark G

I store a large HTML string in a table and would like to
be able to open Internet Explorer with the html by
clicking a button on a form. I can do everything in VBA
but open IE with the HTML. The optimal solution would be
to pass in the string when opening IE so that it is clean
and easy. Does anyone have any code that will open IE
from within VBA? I am using Access 2000 and IE 6.

Secondly, I have recently learned to code html and love
the possibility of creating reports in html, from VBA
code, and opening them in IE; sorry but Access reports are
not by favorite feature. Can someone recommend a website
that has examples of code that accomplishes this goal?
The possibilites for html reporting are endless since you
can control the entire look of the page. Plus you can
pass in vbscript and gain even more control and
functionality.

Thanks in advance!!!
 
K

Kim Mitchell

Have you tried Shell?

Shell "C:\Program Files\Internet Explorer\iexplore.exe C:\MyPage.htm"
or
y = Shell "C:\Program Files\Internet Explorer\iexplore.exe C:\MyPage.htm"

Kim
 
P

Philippe Oget

Quite simple:

Sub RunFile(FileToRun)
On Error Resume Next
Dim WsShell
CreateFSOobject
Set WsShell = CreateObject("Wscript.Shell")
WsShell.Run Chr(34) & FileToRun & Chr(34)
Set WsShell = Nothing
End Sub

RunFile Destination & "\" & FileToOpen & ".html"
or
RunFile D:\My Documents\xl\NetworkLinksOrg\index.html

Philippe
 

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

Top