ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   add ref to Microsoft HTML Object Library (https://www.excelbanter.com/excel-programming/384671-add-ref-microsoft-html-object-library.html)

p3plyr

add ref to Microsoft HTML Object Library
 
hi

i am working with VBA, and due to the nature of my project, i am using the
web browser.

if i go to the visual basic editior in excel, select tools, referecnes, and
scroll down and select Microsoft HTML Object Library the code will fire
without a hitch.

however, another user might not have Microsoft HTML Object Library
referenced and when they go to use the routine it will bug out.

so my question is, how can i code it directly into the VBA to reference the
Microsoft HTML Object Library to make sure whoever uses the program doesnt
have a problem

thanks


NickHK

add ref to Microsoft HTML Object Library
 
Microsoft HTML Object Library (MSHTML.dll) is the component that renders the
HTML for IE. As such, it should be on all versions of Windows that come with
IE.
However, you may have versioning problems if you write your code on a new
machine and a user has an older version.
The easiset way is write code on a system that has the oldest version you
expect to support.

Otherwise look to late binding:
http://peltiertech.com/Excel/EarlyLateBinding.html

Dim MyHTML As Object
Set MyHTML =CreateObject("MSHTML.<WhichClass")
'...etc

This page a lot of ways of working with web pages:
http://www.microsoft.com/mind/0898/dom.asp

NickHK

"p3plyr" wrote in message
...
hi

i am working with VBA, and due to the nature of my project, i am using the
web browser.

if i go to the visual basic editior in excel, select tools, referecnes,

and
scroll down and select Microsoft HTML Object Library the code will fire
without a hitch.

however, another user might not have Microsoft HTML Object Library
referenced and when they go to use the routine it will bug out.

so my question is, how can i code it directly into the VBA to reference

the
Microsoft HTML Object Library to make sure whoever uses the program doesnt
have a problem

thanks





All times are GMT +1. The time now is 02:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com