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!

Open Excel

Status
Not open for further replies.

Dickx

Technical User
Aug 24, 2001
33
US
What would be the code behind a command button in Access to open Excel to a specific spreadsheet and worksheet.

c:\order.xls

Worksheet Summary
 
Try

Dim MyXL as Excel.Application
Dim MyWorkbook as Excel.Workbook
Dim MySheet as Excel.WorkSheet

Set MyXL = New Excel.Application
Set MyWorkbook = Excel.Workbooks.Open("C:\Order.xls")
Set MySheet = MyXL.Sheets("Sheet 1")

You may have to play with this depending on the version of Excel and Access. Also look in "HELP" for the "GetObject" function.

Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top