open an excel file

D

Database User

what is the visual basics code to create a command button to open an excel
file?
 
A

Allan Murphy

Use the shell command

Sub open_excel()
Dim app_name As String

app_name = "C:\Program Files\Microsoft Office\OFFICE11\excel.exe
d:\common\abc.xls"

Call Shell(app_name, 1)

End Sub

C:\Program Files\Microsoft Office\OFFICE11\excel.exe is where the excel.exe
file is located

d:\common\abc.xls is the name of the excel file to open.

Alternatively you could use a hyperlink, look up the help file for this
item.
 
D

Dries Van Poucke

Dear,

If you go to support.microsoft.com and search there for "automation" and
"excel" for Access, you'll find very useful examples how to imbed Excel in
Acces.

Dries
 
Top