Open a specific Excel Doc from Access Form

Melaz29

Registered User.
Local time
Today, 18:01
Joined
Feb 6, 2006
Messages
31
I know how to create a command button to open excel, but is there a way to create a command button to open a specific excel file?
 
Found it myself incase anyone needs to know

Private Sub Command??_Click()
OpenExcelFile ("FileLocation.xls")
Dim objXL As Object

On Error Resume Next

Set objXL = GetObject(, "Excel.Application")
Set objXL = GetObject(strPathToFile)

objXL.Application.Visible = True
objXL.Parent.Windows(1).Visible = True

End Sub
 

Users who are viewing this thread

Back
Top Bottom