Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Giving proper mesage when library is not available.

Status
Not open for further replies.

keshor

Vendor
Apr 28, 2003
1
US
I have an excel template uses MSXML3.dll. So to use my template user must have installed MSXML3 before. I want to throw a proper message when MSXML3 is not installed in the machine. Right now when i start running the macro it shows the code and shows MSXML3 object not defined.(I guess it comiles the code whenever it is run.) I tried the following code. Still doesnt work.

......
strfilename = Dir$("C:\WINNT\system32\msxml3.dll")
If strfilename = "" Then
MsgBox "MS XML components are not installed properly on your machine.", vbCritical
Application.DisplayAlerts = False
Application.Quit
Exit Sub
End If
.......

 
sub my_sub()

on error goto err_hit

strfilename = Dir$("C:\WINNT\system32\msxml3.dll")
Application.DisplayAlerts = False
Application.Quit
Exit Sub

err_hit:
MsgBox "MS XML components are not installed properly on your machine.", vbCritical

resume

end sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top