Hello likestheaction,
Here is a routine that will check if the DLL files exists or not. If it does exist, VBA will attempt to register it. If it doesn't exist, the user is alerted. You can change the file name and path to what you are using.
Sub SelfRegister()
Dim FileName As String
Dim SysPath As String
FileName = "user32.dll"
SysPath = Split(Environ("Path"), ";")(1) & "\"
If Dir(SysPath & FileName) <> "" Then
Shell "regsvr32.exe " & SysPath & FileName
Else
MsgBox FileName & " is missing. Please install this file.", vbInformation
Exit Sub
End If
End Sub
Sincerely,
Leith Ross
Bookmarks