Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Launching Exel from MS ACCESS

Status
Not open for further replies.

Sillygirl

Programmer
May 3, 2002
80
US
Is there anyway to launch Excel from ACCESS?
 
Give this a try. I created a form with a command button called cmdImport.

Private Sub cmdImport_Click()
Dim objXL As Object

On Error GoTo err_cmdImport_click

On Error Resume Next
Set objXL = CreateObject("Excel.Application")

With objXL.Application
.Visible = True
'Open the Workbook
.Workbooks.Open "C:\YourExcelFile.xls"
.Quit
End With
Set objXL = Nothing

Hope this helps!
 
Oops, use this. I tried to cut and paste the code from my application, but left somethings you don't need. Try this:

Private Sub cmdImport_Click()
Dim objXL As Object

On Error Resume Next
Set objXL = CreateObject("Excel.Application")

With objXL.Application
.Visible = True
'Open the Workbook
.Workbooks.Open "C:\YourExcelFile.xls"
End With
Set objXL = Nothing

This should be better.
 
If you don't plan on VBA interaction try this:


i = Shell("excel.exe", 1)


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top