Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Private Sub Form_Open()
' VBA c:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6.DLL
' Access c:\Program Files\Microsoft Office\Office\MSACC9.OLB
' stdole c:\windows\SYSTEM\StdOle2.Tlb
' ADODB C:\PROGRAM FILES\COMMON FILES\SYSTEM\ADO\msado21.tlb
' ADOX C:\PROGRAM FILES\COMMON FILES\SYSTEM\ADO\MSADOX.DLL
' ADOR C:\PROGRAM FILES\COMMON FILES\SYSTEM\ADO\MSADOR15.DLL
If Not CheckSetRef("VBA", "c:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6.DLL") Then
MsgBox "VBA library reference failed"
ElseIf Not CheckSetRef("Access", "c:\Program Files\Microsoft Office\Office\MSACC9.OLB") Then
MsgBox "Access library reference failed"
ElseIf Not CheckSetRef("stdole", "c:\windows\SYSTEM\StdOle2.Tlb") Then
MsgBox "stdole library reference failed"
ElseIf Not CheckSetRef("ADODB", "C:\PROGRAM FILES\COMMON FILES\SYSTEM\ADO\msado21.tlb") Then
MsgBox "ADODB library reference failed"
ElseIf Not CheckSetRef("ADOX", "C:\PROGRAM FILES\COMMON FILES\SYSTEM\ADO\MSADOX.DLL") Then
MsgBox "ADOX library reference failed"
ElseIf Not CheckSetRef("ADOR", "C:\PROGRAM FILES\COMMON FILES\SYSTEM\ADO\MSADOR15.DLL") Then
MsgBox "ADOR library reference failed"
Else
Exit Sub
End If
Domd.Quit
End Sub
Public Function CheckSetRef(RefName As String, RefPath As String) As Boolean
'###################################################################'
' Checks to see if a Refernce exist that matches RefName '
' AND check that the link is not broken. '
' If the check fails then it sets up a link using RefPath '
' '
' Returns True if check turned out Okay or if link was successful '
'###################################################################'
Dim ref As Reference
CheckSetRef = False
For Each ref In Application.References
If ref.Name = RefName _
And ref.IsBroken = False _
Then CheckSetRef = True
Next
If CheckSetRef Then
' Link to Reference library exists so make no change
Else
CheckSetRef = ReferenceFromFile(RefPath)
End If
End Function
Private Function ReferenceFromFile(strFileName As String) As Boolean
'###################################################################'
' Used by Function above to do the establishing of the Reference '
'###################################################################'
Dim ref As Reference
On Error GoTo Error_ReferenceFromFile
Set ref = References.AddFromFile(strFileName)
ReferenceFromFile = True
Exit_ReferenceFromFile:
Exit Function
Error_ReferenceFromFile:
If Err.Number = 32813 Then
Resume Next
Else
MsgBox Err & ": " & Err.Description, , Err.Number
ReferenceFromFile = False
Resume Exit_ReferenceFromFile
End If
End Function
Sub removeRef()
Dim ref As Reference
Dim refs As References
Set refs = ActiveWorkbook.VBProject.References
For Each ref In refs
If ref.Description = "Microsoft Browser Helpers" Then
refs.Remove ref
End If
Next ref
End Sub