open an excel file

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

Guest

what is the visual basics code to create a command button to open an excel
file?
 
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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top