Dim accessApp
Set accessApp = CreateObject("Access.Application")
accessApp.Visible = True
accessApp.UserControl = True
accessApp.OpenCurrentDataBase ("C:\MyPath\Database.accdb")
Dim excelApp As Object
Set excelApp = CreateObject("Excel.Application")
excelApp.Visible = True
excelApp.Workbooks.Open "C:\MyPath\File.xlsx", True, False
Set excelApp= Nothing
Dim x As Variant
Dim path As String
Set the Path variable equal to the path of your program's installation
path = "C:\Program Files (x86)\APP\application.exe"
x = Shell(path, vbNormalFocus)
Dim user_name As String
user_name = Environ("UserName")
If user_name = "YourWindowsLogin" Then
Dim MyTxtFile
MyTxtFile = Shell("C:\WINDOWS\notepad.exe C:\YourFolder\SQL.txt", 1)
Else:
End If
Dim Wordapp as Object
Dim Docapp as Object
Set Wordapp = CreateObject("Word.Application")
Set Docapp = Wordapp.Documents.Open("C:\MyWordFilee.docx")
Wordapp Visible = True
Sub Opening_pdf()
x = "C:\myfile.pdf"
y = "C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe"
'1st way
ThisWorkbook.FollowHyperlink x
'2nd way
Shell y & " " & x, vbNormal '2nd way
End Sub