How to open exisiting MS Excel File from MS Access Database?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i m running my Inventory system in MS Access Database. now i want Add 1
button in Database which opens my desired MS Excel file. i want to know any
Event procedure or Macro.
 
Use Shell to open Excel, specifying the name of the file to open:

Private Sub OpenWorksheet()
Private OpenExcel As Variant
OpenExcel = Shell("Excel.exe " & "C:\FilePath\FileName", 0)
End Sub

Because "Excel.exe" can be in different folders, depending on the version of
Office on the PC, you may need to include the path to the folder containing
Excel.exe in each PC's Path environment variable, or it may not be able to
find Excel.exe.
 
Back
Top