Sub Barcode_Main() Call Barcode_Font End Sub
Public Sub Barcode_Font() Dim FontInstalled As Boolean FontInstalled = IsFile(Environ("LOCALAPPDATA") & "\Microsoft\Windows\Fonts\fre3of9x.ttf") If FontInstalled = False Then Dim Font As String Font = "C:\barcode\fre3of9x.ttf" Shell "C:\WINDOWS\explorer.exe """ & Font & "", vbNormalFocus CreateObject("Excel.Application").Wait (Now + TimeValue("00:00:01")) SendKeys "%{i}", True CreateObject("Excel.Application").Wait (Now + TimeValue("00:00:05")) SendKeys "%{f4}", True ' Alt + F4 End If End Sub
Public Function IsFile(ByVal fName As String) As Boolean On Error Resume Next IsFile = ((GetAttr(fName) And vbDirectory) <> vbDirectory) End Function