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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there an Excel Open in Access?

Status
Not open for further replies.

Fortborg

Technical User
Jul 26, 2001
15
0
0
US
Hey,

I've tried many code variations to get Access to open a specific Excel file "VouchersDatabase.Xls", and I've been able to get Access to open the file, but only after getting some kind of macro prompt. I can't see a way to get Access to cleanly open a specific Excel file for me. Any suggestions?

Thanks,
Fort
 
Browse to the file in the hyperlink field. Add it to a form as a label or a command button.

Sean.
 
Create an 'event procedure' to open on the 'on-click' event behind a command button and try to open the .xls from there:
EG

Private Sub OpenXls_Click()
On Error GoTo Err_OpenXls_Click

Dim RetVal
RetVal = Shell("C:\Program Files\Microsoft Office\Office\EXCEL.exe T:\"VouchersDatabase.xls", 1)
;WHERE C: IS THE LOCATION OF Excel
;AND T: IS THE LOCATION OF THE .xls

Exit_OpenXls_Click:
Exit Sub

Err_OpenXls_Click:
MsgBox Err.Description
Resume Exit_OpenMatrix_Click

End Sub

Good Luck
 
Have a look at my FAQ:faq705-1971 which does just what you want!

B ----------------------------------
Ben O'Hara
Home: bpo@RobotParade.co.uk
Work: bo104@westyorkshire.pnn.police.uk
Web: ----------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top